Hi,
I've made the following script but it doesn't seem to work 🙁
It just skips changing the file and closes.
What can i do to make it work?
<?
$userlist = file("users.inc.php");
$done = false;
$auth = false;
$found = false;
$i = 0;
while ((!$found) && ($i<count($userlist))) {
$i++;
list($n,$p,$a,$e,$g,$s,$m,$a1,$a2,$a3) = explode(':',$userlist[$i]);
$found = ($n==$user);
if (!$price) { die("<br><b>Error</b><br>"); }
elseif ($item == '1' && $m >= $price) {
$m -= $price;
$a3 += '1';
$m = ($m < $price) ? $m : $m;
$userlist[$i] = implode(':',array($n,$p,$a,$e,$g,$s,$m,$a1,$a2,$a3));
$fd = fopen("users.inc.php","w");
fputs($fd,"<?php die(\"Access restricted\"); ?>\n");
for ($i=1; $i<count($userlist); $i++) {
fputs($fd,chop($userlist[$i])."\n");
}
fclose($fd);
echo "<script>window.close();</script>";
}
}
?>