内容提要:有时你需要知道你的站点访问者来自哪个国家比如如果你正打算执行针对地理区域的广告计划。本文将对此方法进行介绍。 有时你需要知道你的站点访问者来自哪个国家比如如果你正打算执行针对地理区域的广告计划。这正是象 …… |
在源程序中,所有用户信息记录在data子目录下user.dat文件中。其格式为:
username:
http://octopus.cdit.edu.cn/~qap213/index.html
附PHP3源程序:
<?
//Get HTTP’s Header and parse it//
= getallheaders();
''www.knowsky.com
while (list(, ) = each()) {
if(=="Host"){= strtok(,".");}}
//Jump out the Banner''s Window//
echo ''<script language="JavaScript">'',
''msg=window.open("banner.htm","sample",
"toolbar=no","directories=no",directories=no","menubar=no");’,
''</script>'';
// seek the user information from the recorded file//
if(!=file("data/user.dat")){echo "Open Data File Error!!";}
="http://";
for(=0;<count();++)
if(strtok(,":")==){
=; }
if(=="http://"){echo "not found the uesrname of Data!";}
else{
echo ''<meta http-equiv="refresh" content="0;'',''url='',,''">'';}