nickp
3-25-02, 02:17 PM
whenever i try to use the following script i get the 500 server error, any help would be aprreciated
#!/usr/local/bin/php
<html>
<?php
$counter_file = "./count1.dat";
if(!($fp = fopen($counter_file, "r"))) die ("Cannot Open $counter_file.");
$counter = (int) fread($fp, 20);
fclose($fp);
$counter++;
echo "You're visitor No. $counter.";
$fp = fopen($counter_file, "w");
fwrite($fp, $counter);
fclose($fp);
?>
</html>
(Note: Count1.dat is the file that keeps track of how many people visited)
#!/usr/local/bin/php
<html>
<?php
$counter_file = "./count1.dat";
if(!($fp = fopen($counter_file, "r"))) die ("Cannot Open $counter_file.");
$counter = (int) fread($fp, 20);
fclose($fp);
$counter++;
echo "You're visitor No. $counter.";
$fp = fopen($counter_file, "w");
fwrite($fp, $counter);
fclose($fp);
?>
</html>
(Note: Count1.dat is the file that keeps track of how many people visited)