我有问题。我有这个代码:
$theUrl = $_GET["url"];
include("$theUrl.php");
这将获取 url,例如:http://mywebsite.com/index.php?url=test
但是如果有人输入怎么办:
http://mywebsite.com/index.php?url=http://theirwebsite.com/someEvilscript
如何避免这种情况?我只想执行我服务器上的脚本,而不是来自其他网站的脚本。感谢帮助。