Simple Counter Code Problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
EskimoBill
Forum Newbie
Posts: 2
Joined: Tue May 30, 2006 8:44 pm

Simple Counter Code Problem

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You're missing a semicolon on the line before.
EskimoBill
Forum Newbie
Posts: 2
Joined: Tue May 30, 2006 8:44 pm

Post by EskimoBill »

ty =P
Post Reply