您将需要使用JS将其中包含变量的URL发送回去,例如:http :
//www.site.com/index.php?uid=1
通过在JS中使用如下代码:
window.location.href=”index.php?uid=1";
然后在PHP代码中使用$ _GET:
$somevar = $_GET["uid"]; //puts the uid varialbe into $somevar

您将需要使用JS将其中包含变量的URL发送回去,例如:http :
//www.site.com/index.php?uid=1
通过在JS中使用如下代码:
window.location.href=”index.php?uid=1";
然后在PHP代码中使用$ _GET:
$somevar = $_GET["uid"]; //puts the uid varialbe into $somevar