以下网址:
https://example.com/rewards.php&id=307658063902(无法通过GET获取ID)
OR
https://example.com/rewards&id=307658063902(未找到返回错误)
使用php检索GET变量ID不起作用:
$id = $_GET["id"];
我认为我的.htaccess文件可能存在错误,即:
Options -Indexes
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ $1.php [NC,L]
答案 0 :(得分:0)
https://example.com/rewards.php?id=307658063902
$id = $_GET["id"];
echo $id;
示例输出:
307658063902