swampone Posted June 30, 2010 Share Posted June 30, 2010 Im having trouble passing varibles to other pages. I can see that the variable there in the url. localhost/page.php?page=1. The I try to echo the value on page.php to see that it is working, and all I get is a blank page. What am I missing here? <?php echo $page; Quote Link to comment Share on other sites More sharing options...
joel24 Posted June 30, 2010 Share Posted June 30, 2010 if the variable is being sent in the URL, you need to use $_GET['variable'] to retrieve it. i.e. localhost/page.php?page=1 $page = $_GET['page']; echo $page; you will want to use isset to ensure no notices are returned, i.e. localhost/page.php?page=1 if (isset($_GET['page']) { $page = $_GET['page']; echo $page; } Quote Link to comment Share on other sites More sharing options...
swampone Posted June 30, 2010 Author Share Posted June 30, 2010 That was it. Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.