Размер файла: 2.33Kb
<?
Error_Reporting(E_ALL & ~E_NOTICE);
include_once("files/antixak.php");
header("Content-type:text/vnd.wap.wml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">";
echo "<wml>\n";
echo "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>";
echo "<card id=\"index\" title=\"Персонаж\">";
echo "<p align=\"left\">";
$log = htmlspecialchars(stripslashes($log));
$pas = htmlspecialchars(stripslashes($pas));
/////////////////////////////////////////////////////
$text = @file("data/reg/$log.dat");
if ($text!=""){
$udata = explode(":||:",$text[0]);
$login=trim($udata[0]);
$password=trim($udata[1]);}
////////////////////////////////////////////////////////
if (md5($pas)==$password && $log==$login && $log!=="" && md5($pas)!=="") {
$file=@file("data/item/$log.dat");
$total=count($file);
$text = @file("data/sellruk/$log.dat");
$data = explode("||",$text[0]);
for($i=0; $i<$total; $i++){
$item = explode(":||:",$file[$i]);
if($item[4]==$data[4]){
$fp=fopen("data/item/$log.dat","w");
flock ($fp,LOCK_EX);
unset($file[$i]);
fputs($fp, implode("",$file));
flock ($fp,LOCK_UN);
fclose($fp);
$all=$data[3]+$item[3];
$text="$data[0]:||:$data[1]:||:$data[2]:||:$all:||:$data[4]:||:";
$fp=fopen("data/item/$log.dat","a+");
flock($fp,LOCK_EX);
fputs($fp,"$text\r\n");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp);
unlink ("data/sellruk/$log.dat");
echo"<small>Продажа отменена.</small>";
include_once"files/down.php";
exit;
}else{
$text="$data[0]:||:$data[1]:||:$data[2]:||:$data[3]:||:$data[4]:||:";
$fp=fopen("data/item/$log.dat","a+");
flock($fp,LOCK_EX);
fputs($fp,"$text\r\n");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp);
unlink ("data/sellruk/$log.dat");
echo"<small>Продажа отменена.</small>";
include_once"files/down.php";
exit;
}}
}else{echo"<small>Пароль или логин неверен!</small>";}
include_once"files/down.php";
?>