PHP Error Message

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
Hawaii02
Forum Newbie
Posts: 4
Joined: Tue May 29, 2007 3:53 am

PHP Error Message

Post by Hawaii02 »

Hi, I'm receiving an error and I need some help fixing it. I'm new to PHP but what I'm doing is not hard. I've set up a link that has an extension set up with a variable like this ...

phptest.php?pagecount=2




I now want to bring that variable into my page so i added these lines at the top

<?php
pagecount = $_GET['pagecount'];
?>

Then I want to display the variable in the page liks this ... <?php echo $_GET["pagecount"]; ?>



However, I get the following error when processing the page

Parse error: parse error, unexpected '=' in /home/affinity/public_html/phptest.php on line 2

pagecount = $_GET['pagecount']; is what is on line 2.

This seems like it shouldn't be too difficult, but i'm new at PHP so I'm having a hard time with it. Any suggestions?
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Make pagecount into $pagecount.

Code: Select all

$pagecount = $_GET['pagecount'];
Hawaii02
Forum Newbie
Posts: 4
Joined: Tue May 29, 2007 3:53 am

Post by Hawaii02 »

that worked ... thank you very much
Post Reply