Вход Регистрация
Файл: poststatus.php
Строк: 21
<?php
include 'config.php';
include 
'functions.php';
$user=$_GET['user'];
$status=$_GET['status'];
if (!empty(
$_SESSION['rand']))
{
$_SESSION['rand']='';
$_SESSION['text']='';
$var='';
$file=file ('users.dat');
$count=count($file);
for(
$i=0;$i<$count;$i++)
{
$ex=explode('#/#/#',$file[$i]);
if (
$ex[0]==$user)
{
$string=str_replace($ex[0].'#/#/#'.$ex[1].'#/#/#'.$ex[2].'#/#/#'.$ex[3].'#/#/#'.$ex[4].'#/#/#'.$ex[5].'#/#/#'.$ex[6].'#/#/#'.$ex[7].'#/#/#'.$ex[8].'#/#/#'.$ex[9].'#/#/#'.$ex[10].'#/#/#'.$ex[11].'#/#/#'.$ex[12].'#/#/#'.$ex[13].'#/#/#'.$ex[14],$ex[0].'#/#/#'.$ex[1].'#/#/#'.$ex[2].'#/#/#'.$ex[3].'#/#/#'.$status.'#/#/#'.$ex[5].'#/#/#'.$ex[6].'#/#/#'.$ex[7].'#/#/#'.$ex[8].'#/#/#'.$ex[9].'#/#/#'.$ex[10].'#/#/#'.$ex[11].'#/#/#'.$ex[12].'#/#/#'.$ex[13].'#/#/#'.$ex[14],file_get_contents("users.dat"));
$fopen=fopen("users.dat","w");
fputs($fopen,$string);
fclose($fopen);
$var='1';
}
}
if (!empty(
$var)) {
$_SESSION['text'].='Статус пользователя успешно изменен!<br/>'; } else {
$_SESSION['text'].='Статус пользователя не изменен!<br/>'; } 
}
header("location:index.php");
?>
Онлайн: 0
Реклама