Monk3h Posted December 20, 2010 Share Posted December 20, 2010 This is driving me MAD! The Variable gets passed through the URL but when I try and echo the result I gte NOTHING. First Page. <?php include'config.php'; $result = mysql_query("SELECT * FROM carbontrust"); while($entry = mysql_fetch_array($result)) Print "$entry[contact] - $entry[company] :: <a href='edit.php?id=$entry[id]'>Edit</a><br>"; exit; ?> Second Page. (Where I want the Variable passed to) <?php include'config.php'; $id = $_GET['id']; echo "ID: $id"; } ?> Its probably just a stupid error but iv looked through a load of tutorials and this should be correct. :/ Quote Link to comment https://forums.phpfreaks.com/topic/222201-passing-a-variable-through-a-url/ Share on other sites More sharing options...
revraz Posted December 20, 2010 Share Posted December 20, 2010 Copy and paste the URL that is being generated. Quote Link to comment https://forums.phpfreaks.com/topic/222201-passing-a-variable-through-a-url/#findComment-1149499 Share on other sites More sharing options...
Monk3h Posted December 20, 2010 Author Share Posted December 20, 2010 http://jaynetdesign.com/carbontrust/edit.php?id=2 the id changes ofc depending on what link is clicked. Quote Link to comment https://forums.phpfreaks.com/topic/222201-passing-a-variable-through-a-url/#findComment-1149501 Share on other sites More sharing options...
bugcoder Posted December 20, 2010 Share Posted December 20, 2010 <?php include'config.php'; $id = $_GET['id']; echo "ID: $id"; } <---- whats its purpose? ?> Quote Link to comment https://forums.phpfreaks.com/topic/222201-passing-a-variable-through-a-url/#findComment-1149502 Share on other sites More sharing options...
Monk3h Posted December 20, 2010 Author Share Posted December 20, 2010 Solved. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/222201-passing-a-variable-through-a-url/#findComment-1149503 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.