Page 1 of 1

Simple Counter Code Problem

Posted: Tue May 30, 2006 8:49 pm
by EskimoBill
well this is my first php script pretty simple tho but i keep getting this error:
Parse error: parse error, unexpected T_VARIABLE in C:\wamp\www\phplearning\home.php on line 8

i have this page of code:

Code: Select all

<html>

<body>
page content<br>
stuff stuff
<?php
$page = "page1.txt"
$handle = fopen($page,w);
$count = fread($handle, filesize($page));
$count++;
fwrite($handle,$count);
fclose($handle);
echo 'This page has been viewed';
echo $count;
echo 'times';
?>
</body>

</html>
I already uploaded a page1 with 0 in it.

ty for help in advance

Posted: Tue May 30, 2006 8:50 pm
by feyd
You're missing a semicolon on the line before.

Posted: Tue May 30, 2006 9:03 pm
by EskimoBill
ty =P