View file ascalon/death/say.php

File size: 1.28Kb
<?
session_start(); if(!isset($_SESSION['ses8'])) {header("Location:../log.php"); exit;} else $ses=$_SESSION['ses8']; $nick=$_SESSION['nick'];
$mt=mt_rand(10000,99999);
if(isset($_GET['do'])) $_GET['do']=htmlspecialchars(stripslashes($_GET['do'])); else $_GET['do']="a"; if(isset($nick2)){ $nick2=htmlspecialchars(stripslashes($nick2)); $nick2="$nick2, ";} else $nick2="";
echo"<html><head><title>Cкaзaть...</title>"; require"../css.php"; echo'</head><body>';
switch($_GET['do']){
case"sprov":
if(!isset($say) || $say=="") { header("Location:death_room.php?mt=$mt"); exit;} $say=htmlspecialchars(stripslashes($say));
$say=trim($say); $say=substr($say,0,255);
$say=str_replace("\r\n", "", $say);
$say=str_replace(":||:","",$say);
$echo="$nick:||:$say\r\n"; $ex=@file("death_room.dat"); $liner=sizeof($ex); $ex[$liner]=$echo; $kex=@implode("",$ex); $mex=@fopen("death_room.dat","w"); fputs($mex,$kex); fclose($mex); header("Location:death_room.php?mt=$mt"); exit;
break;
default:
echo"<div class=text><form action=\"say.php?mt=$mt&amp;do=sprov\" method=\"post\"><input type=\"text\" name=\"say\" value=\"$nick2\"><br><input type=\"submit\" value=\"cкaзaть\"></form><br></div><br>* * * * *<br><div class=kto><a href=\"death_room.php?mt=$mt\">назад</a></body></html>";
break;}
?>