View file nkat/in.php

File size: 1.54Kb
<?php

include "xconf.php";
// проверка браузера и если это опера то переход не считаем!
$agent = $HTTP_USER_AGENT;
$mobile=strtok($agent,"/");
if ($mobile=="Opera"||$mobile=="Mozilla") {

header ("Content-type:text/vnd.wap.wml; charset=utf-8");

print"<?xml version=\"1.0\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">
<wml><head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>
<card title='Go' ontimer='$site'><timer value='1'/><p><a href='$site'>loading...</a><br/><br/>
</p></card></wml>";
}
// если не опера то все нормально!
else
{
$id=intval($id);
$sd="qwertyuiopadfghjklzxcvbnm0123456789";
$size_sd=strlen($sd)-1;
$in="";
for($ab=0;$ab<32;$ab++){
$in.=$sd[rand(0,$size_sd)];}
$ipss = getenv('REMOTE_ADDR');
$q=mysql_query("select * from `cool_pro` where id='$id' and ip='$ipss';");
$rows=mysql_num_rows($q);
if($rows=="0"){@mysql_query("insert into `cool_pro` values('$id','$datecool','$ipss','$in')");
$coolip=$ipss.".555";
@mysql_query("insert into `cool_pro` values('$id','$datecool','$coolip','$in')");}

header ("Content-type:text/vnd.wap.wml; charset=utf-8");

print"<?xml version=\"1.0\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">
<wml><head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>
<card title='Go' ontimer='$site/?id=$id&amp;in=$in'><timer value='1'/><p><a href='$site/?id=$id&amp;in=$in'>loading...</a><br/><br/>
</p></card></wml>";}

?>