Просмотр файла shapka.php

Размер файла: 3.33Kb
<?php
//////////////////////////
//ВЫ не имеете права убирать копирайт
/////////////////////////
////////////////////////
$url1=explode('?',$_SERVER['REQUEST_URI']);
$url=basename($_SERVER['PHP_SELF']).'?'.@$url1[1];
$url=htmlspecialchars($url);
$str=@$_GET['str'];
if(@$str!='wml' and @$str!='xhtml')
{
if(strstr($_SERVER['HTTP_ACCEPT'], 'wml') and !strstr($_SERVER['HTTP_ACCEPT'], 'html'))
$str='wml';
else
$str='xhtml';
}
if(@$str=='wml')
{
@header("Content-Type: text/vnd.wap.wml; charset=utf-8"); 
if(!@$url1[1])
$url=$url.'str=wml';
else
{
if(!strstr($url, 'str=wml'))
$url=$url.'&amp;str=xhtml';
else
$url=str_replace('str=wml','str=xhtml', $url); }
$beginpage='<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<head>
<meta http-equiv="Pragma" content="no-cache" forua="true"/></head><card id="main" title="'.$title.'"><p align="'.$align.'"><small>';
$vydel='<i>';
$vydel1='</i>';
$vydel2='<i>';
$razd='------<br/>';
$endpage='
<b>
<a href="http://'.$site.'">'.$nazv.'</a><br/>'.$razd.'
wml||<a href="'.$url.'">xhtml</a><br/>
(c) <a href="http://pokerwap.ru">flyd</a><br />
</b>';
$endpage.='</small></p></card></wml>';}
else
{
if(!@$url1[1])
$url=$url.'str=wml';
else
{
if(!strstr($url, 'str=xhtml'))
$url=$url.'&amp;str=wml';
else
$url=str_replace('str=xhtml','str=wml', $url); }
@header("Content-Type: text/html; charset=utf-8");
$beginpage='<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
	'.$refr.'
		<meta http-equiv="content-type" content="text/html;charset=utf-8" />

<link rel="stylesheet" href="/chat/0.css" type="text/css" />
		<title>'.$title.'</title>
	</head><body><div>';
$vydel='</div><div class="f">';
$vydel1='</div><div>';
$vydel2='</div><div class="c3">';
$razd='<hr/>';
$endpage='
</div><div class="f">

<a href="http://'.$site.'">'.$nazv.'</a><br/>'.$razd.'<div class="c2">
xhtml||<a href="'.$url.'">wml</a><br/>
';
//$onl_c->count_onl(); 
$endpage.='
</div>(c) <a href="http://pokerwap.ru">flyd</a><br />
</div></body></html>';
}


//Бан по ip+браузер
$ip1=mysql_real_escape_string($_SERVER['REMOTE_ADDR']);        
$user1=mysql_real_escape_string(htmlspecialchars(substr($_SERVER['HTTP_USER_AGENT'],0,40)));
$ips = explode('.',$ip1);
$longip = $ips[3] + $ips[2] * 256 + $ips[1] * 256 * 256 + $ips[0] * 256 * 256 * 256;
$ipres=mysql_query("SELECT * from `ipban` WHERE (`ipstatus`=0 OR (`ipst`<=$longip AND `ipend`>=$longip)) AND (`userstatus`=0 OR `user`='$user1') limit 1") or die(mysql_error());
if(mysql_num_rows($ipres))
	{
	print $beginpage;
	print "извините, но вам закрыт вход в чат<br />";
	print $endpage;
	exit;
	}
if(file_get_contents('kompon.txt'))
	{
	$juser=explode('/',$_SERVER['HTTP_USER_AGENT']);
	if(strstr($_SERVER['HTTP_USER_AGENT'],'MSIE') or ($juser[0]=='Opera' and !strstr($_SERVER['HTTP_USER_AGENT'],'Mini')) or strstr($_SERVER['HTTP_USER_AGENT'],'Mozilla'))
	{
	print "$beginpage";
	print "извините, вход  чат открыт только для мобильных телефонов<br />";
	print $endpage;
	exit;
	}
	}
?>