Thanks cornedbee, as you typed that i figured out that i was reading it twice and killing the data.
but i dont think im even getting to the open_file function, because it refuses to echo anything, even the first $contents.PHP Code:<?php
function open_file($filetype,$increment,$filename)
{
$handle = fopen($filename, 'r');
$contents = @fread($handle,filesize($filename));
fclose($handle);
If($increment == '-'){
$contents--;
}else{
$contents++;
}
$handle = fopen($filename, $filetype);
fwrite($handle,$contents);
fclose($handle);
echo $contents;
return $contents;
}
Switch($_GET['user']){
Case "+":
echo open_file('w','+','users.txt');
Case "-":
echo open_file('w','-','users.txt');
}
?>
Thanks much![]()





Reply With Quote