File size: 1.45Kb
<?php
include "xconf.php";
$agent = $HTTP_USER_AGENT;
$mobile=strtok($agent,"/");
$id=intval($id);
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;
for($ab=0;$ab<32;$ab++){
$kod1.=$sd[rand(0,$size_sd)];}
$kode=base64_encode(base64_encode($kod1));
$id=$HTTP_GET_VARS['id'];
If (is_numeric($id)) {
$res=mysql_query("select * from `cool_site` where id='$id'");
$kols=mysql_num_rows($res);
If ($kols!=0){
@mysql_query("insert into `kods` values('$id','$kod1')");
}
}
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&kod1=$kod1'><timer value='1'/><p><a href='$site/?id=$id&kod1=$kod1'>loading...</a><br/><br/>
</p></card></wml>";
}
?>