取得当前访问网址和浏览者IP的函数
<?php
$url=$_SERVER['HTTP_HOST'];
$url.=":".$_SERVER['SERVER_PORT'];
$url.=$_SERVER['PHP_SELF'];
$url.=$_SERVER['QUERY_STRING'];
echo $url;
?>
<?php
$ip=$_SERVER['REMOTE_ADDR'];
$ip1 = getenv('HTTP_X_FORWARDED_FOR');
if (($ip1 != "") && ($ip1 != "unknown"))
$ip=$ip1;
?>
$url=$_SERVER['HTTP_HOST'];
$url.=":".$_SERVER['SERVER_PORT'];
$url.=$_SERVER['PHP_SELF'];
$url.=$_SERVER['QUERY_STRING'];
echo $url;
?>
<?php
$ip=$_SERVER['REMOTE_ADDR'];
$ip1 = getenv('HTTP_X_FORWARDED_FOR');
if (($ip1 != "") && ($ip1 != "unknown"))
$ip=$ip1;
?>