如何确定请求是否从我的计算机到php页面?
我想用print_r($GLOABALS)
从我的计算机调试我的站点,但我不希望其他计算机这样做。
<?php
// can not use ip to judge wheather this computer is mine
// for my ip will change always.
if($is_my_computer){
echo 'yes';
}
我想在你的本地机器你有你的网站在localhost/mylocalwebsite。如果是这样,只要检查一下你是否在这种环境中,就可以了。
<?php
if($_SERVER['SERVER_NAME'] == 'localhost') {
echo "foo";
}