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

Размер файла: 4.61Kb
<? 
//Мини чат(ChatBox)
//Версия 2.0
//Автор DarveL([email protected])
//icq:498955022

//Копирайт убирать без разрешения автора-Запрещено.
//В этом случае бесплатная поддержка не оказывается.
//Уважайте труд автора.
?>
<?
header('pragma: no-cache');
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<title>ЧатиГ</title>
<script src="tr.js" language="JavaScript">
</script>
</head>
<style>
div.r { border: 1px solid; color: #669966;}
div.data {color: #1d73a0;}
a{ color: #996600; text-decoration: none }
input.ibutton {
color: #FFFFFF;
background-color: #000000;
border-top: 1px solid #FFF;
border-left: 1px solid #FFF;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
padding: 0px 2px 0px 2px;
}
</style>
<body text="#601e11">

	<div align="center"><img src="img/logo2.gif" alt="Мини-Чат"></div><br><br>

<?
include ("conf.php");
include ("chat.php");
include ('online.php');
/*<div align="center">
<iframe name="site" src="chat.php" style="position: left;width:749; height:2950; scrolling=no; allowtransparency="none" scrolling="no" frameborder=0 border=0></iframe>
</div>*/
?>

<? 
$rand=rand(1000,9999);
?><br><br><br>
<?
 $ip_us=htmlspecialchars(stripslashes(trim($_SERVER['REMOTE_ADDR'])));
 $qe=mysql_query("SELECT * FROM ban WHERE ip LIKE '$ip_us' "); 
            $reg=mysql_num_rows($qe);
           if (mysql_affected_rows()!==0)
           {
		   echo 'Вы забанены администратором!<br>';
               
				    }
           else
           {
		   
	echo '
<table height="200" width="100%" border="0" cellspacing="0" cellpadding="0"><tbody>
<tr>
    <td width="25%">&nbsp;</td>
    <td width="50%" bgcolor="#DEDCC7" valign="top">Форма быстрого ответа:<br>
<form name=add action="index.php?mes='.$rand.'" method="post" onsubmit="return SendForm();">';
echo '
<div align="center">Имя:*<input type="text" name="name" value=';
if(isset($_COOKIE['cook'])) {
		   $cook=htmlspecialchars(stripslashes(trim($_COOKIE['cook']))); 
		   echo $cook;}
		   echo '>&nbsp;
E-mail: <input type="text" name="email"><br>
<input type="hidden" name="pr" value="'.$rand.'"><br>
Сообщение:*
<textarea name=message class=forms rows="3" cols="48"></textarea><br>
<input type="submit" class="ibutton" value="Отправить"></div> <br> * - необходимые для заполнения поля
</form><br>
<div align="center">
<form action="tr.js">
<input type="button" class="ibutton" value="help" onclick="help();">
<input type="button" class="ibutton" value="smiles" onclick="smiles();">
<input type="button" class="ibutton" value="smiles2" onclick="smilesdop();">
</form></div>
</td>
    <td width="25%">&nbsp;</td>
</tbody></table>';
echo on_line(); } ?>
<?
if(!empty($_POST['name']) and !empty($_POST['message']) and !empty($_POST['pr']) and !empty($_GET['mes']))
{
$pr=htmlspecialchars(stripslashes(trim($_POST['pr'])));
$pr=(int)$pr;
$mes=htmlspecialchars(stripslashes(trim($_GET['mes'])));
$mes=(int)$mes;
if($pr==$mes){
$name=htmlspecialchars(stripslashes(trim($_POST['name'])));
$name= mysql_escape_string(htmlspecialchars($name));
setcookie ("cook", $name);    
$email=htmlspecialchars(stripslashes(trim($_POST['email'])));
$email= mysql_escape_string(htmlspecialchars($email));
$message=htmlspecialchars(stripslashes(trim($_POST['message'])));
$message=mysql_escape_string(htmlspecialchars($message));
$name= strip_tags($name);
$email= strip_tags($email);
$message= strip_tags($message);
if($name!="" and $message!=""){
if ($noreklama=1) { include ("filtr.php"); }
if ($nomat=1) {include ("filtrmat.php"); }
if($email!="") {
if (!eregi("^[a-z0-9\._-]+@[a-z0-9\._-]+\.[a-z]{2,4}\$", $email)) { echo 'Ошибка ввода e-mail';
echo '<a href="index.php?mes=">назад</a><br><br>';
exit();
 }}
 $ip_user=htmlspecialchars(stripslashes(trim($_SERVER['REMOTE_ADDR'])));
$date=date("H:i");
$dates=date("m.d.Y");
$rand=rand(1000,9999);
$mes=rand(1000,9999);
$pr=rand(1000,9999);
@mysql_query("insert into chat values(0,'$name','$email','$message','$date','$dates','$ip_user');")or die ("Errors connects");
echo '<meta http-equiv="refresh" content="3; url=index.php?mes=7777">';
echo 'Сообщение добавлено <a href="index.php?mes=">перейти</a><br><br>';
}}}
?><br>
<div align="center">
Все права принадлежат DarveL &copy;
</div>
</body>
</html>