View file send.php

File size: 1.31Kb
<?
error_reporting(0); 
include "config.php";
if (empty($msg))
{
$error = $error."msg_error";
}
if (empty($nick_user))
{
$error = $error."error_nick";
}
if (!empty($pass_user))
{
$viewmess = file("data/$nick_user.$antihak.txt");
$viewmess = explode("|", $viewmess[0]);
$nick = $viewmess[0];
$name = $viewmess[3];
$status = $viewmess[11];
}
else
{
$nick=$nick_user;
}
if (empty($name))
{
$name=$nick;
}
$file = file("chat.txt");
$file = explode("|", $file[0]);
$mess_user = $file[4];
if ($msg==$mess_user)
{
header ("Location: index.php?infa=two_msg&name=$nick_user&pass=$pass_user");
}
else
{
$u1=getenv("HTTP_USER_AGENT");
$mobile=strtok($u1,"/");
$user="$mobile: $REMOTE_ADDR";
$nick_user = substr($HTTP_POST_VARS["nick_user"],0,32);
$nick_user = htmlspecialchars(stripslashes($nick_user));
$msg = substr($HTTP_POST_VARS["msg"],0,3000);
$msg = trim($msg); 
if (empty($error))
{
$msg=del($msg);
$msg=bbcode($msg);
$msg=antimat($msg);
$msg=str_replace($sstr,$simg,$msg);
$base = 'chat.txt';
$back = @file_get_contents("chat.txt");
$file = fopen("$base","w");
fputs($file,"$nick|$status|$name|$time $date|$msg|$user"."\r\n"."$back");
flock ($file,LOCK_UN);
fclose($file);
header ("Location: index.php?rand=$randlink&name=$nick_user&pass=$pass_user");
}
else
{
header ("Location: index.php?infa=$error&name=$nick_user&pass=$pass_user");
}
}
?>