【发布时间】:2014-10-24 06:03:54
【问题描述】:
我正在尝试使用 $_GET 获取两个参数,如下所示:
index.php:
<?php
include("../includes/simple_html_dom.php");
echo ("<!-- Written By: Alaa Elrifaie -->\n");
// Fetch user input
$data = htmlspecialchars($_GET["data"]);
$key = htmlspecialchars($_GET["key"]);
// Test if values have been fetched
echo($data . '<br>' . $key);
?>
像这样传递一个单词时效果很好:
http://www.mywebsite.com/index.php?data=OneWord&key=AlsoOneWord
但在尝试传递完整字符串时会出现“404 错误”:
http://www.mywebsite.com/index.php?data=This is a set of data&key=This is the key!
// This doesn't work
如何解决?因为这是我实现它的必要条件!
【问题讨论】:
-
你能告诉我你的网站是做什么的吗?
-
urlencode()你的参数
-
3行代码被学分包围,笑死我了;p
-
@LozCheroneツ 你什么意思?
-
@LozCheroneツ 好的,我明白了。我也是。也许这是他们的第一个节目
标签: php string get url-parameters