Не работает php код, где ошибка?
<?php
$myfl = "val.txt";
if(isset($_GET['Check'])) {
if($_GET['Check'] == "retvalinc") {
$fh = fopen($myfl, "r+");
echo("onetrue");
$fileval = fread($fh, sizefile($fh));
fclose($fh);
echo $fileval;
} else if($_GET['Check'] == "Increment" || $_GET['Check'] == "Incrementator") {
$fh = fopen($myfl,"r+");
$fileval = fread($fh,sizefile($fh));
fclose($fh);
$fh = fopen($myfl,"w+");
settype($fileval,integer);
$success = fwrite($fh,$fileval+1);
} else if($_GET['Check'] == "Decrement" || $_GET['Check'] == "Decrementator") {
$fh = fopen($myfl,"r+");
$fileval = fread($fh,sizefile($fh));
fclose($fh);
$fh = fopen($myfl,"w+");
settype($fileval,integer);
$success = fwrite($fh,$fileval-1);
}
}
?>