Page 1 of 1

PHP Error Message

Posted: Wed May 30, 2007 7:56 pm
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?

Posted: Wed May 30, 2007 7:58 pm
by superdezign
Make pagecount into $pagecount.

Code: Select all

$pagecount = $_GET['pagecount'];

Posted: Wed May 30, 2007 8:03 pm
by Hawaii02
that worked ... thank you very much