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?
PHP Error Message
Moderator: General Moderators
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Make pagecount into $pagecount.
Code: Select all
$pagecount = $_GET['pagecount'];