【发布时间】:2018-10-29 14:17:52
【问题描述】:
我的代码需要帮助:
我在 index.php 中包含页面,例如:
if(isset($_GET['xx'])
{
// include('yy/'.$_GET['xx'].'.php');
}
现在在文件 page.php 中,我想使用 get 参数,例如 from 和 to。 我使用 htaccess 作为短网址
RewriteRule ^([a-z]*)$ ./main.php?xx=$1
所以我最终得到了这个网址:
index.php?xx=page?from=a&to=b
当我 print_r($_GET) 我只得到第一个参数 xx
$_POST 参数工作正常,但我需要它与 $_GET。
【问题讨论】:
-
index.php?xx=page&from=a&to=b
-
^ 是正确的,问题是错字。
-
投票以错别字结束
-
您好,感谢您的回答。我知道这是获取它们的正确方法。但我包括获取参数页面,在这个页面上我想获取其他参数。
-
也作为安全检查,在致电
include()之前,请注意通过$_GET发送的内容。
标签: php post parameters get