Académique Documents
Professionnel Documents
Culture Documents
php
include 'nclink.php';
#include 'engine_inc.php';
##########################
##########################################
$defaultURL="http://www.arcai.com/speed-test/";
if (!isset($_GET['query'])) {
header("Location: $defaultURL");
//mysql_close();
exit;
}
$query=$_GET['query'];
###################################
if ($rows==0){
header("Location: $defaultURL");
//mysql_close();
exit;
}
$bNeedSwitch=false;
$lastUrl="";
$newUrl=$defaultURL;
if (isset($_COOKIE[$cookiename])) {
$value=$_COOKIE[$cookiename]; //Url+LastTime
$values = explode("\n",$value);
$lastUrl=$values[0];
$LastTime=$values[1];
if(time()-$LastTime<60*60*9) #����ϴη���ʱ����뵱
ǰʱ��С��8Сʱ���ӣ�����Ҫ�л����������8Сʱ��������Ҫ�л�
{
$bNeedSwitch=true;
}
#echo "found Cookie $cookiename $value<br>\n";
}
if($bNeedSwitch)
{
foreach ($urls as $url) {
#echo "Checking url: $url<br>\n";
if(strcasecmp($url,$lastUrl)==0)
{
#echo "Found last visit url: $url<br>\n";
break;
}
$nCount++;
}
if($nCount>=(count($urls)-1))
{
$nCount=0;
}
else {$nCount++;}
$newUrl=$urls[$nCount];
$newValue="$newUrl\n".time()."\n";
$location="Location: $newUrl";
header($location);
#echo "$location";
//mysql_close();
#################################
?>