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. :/ 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. 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. 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? ?> 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. 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
Archived
This topic is now archived and is closed to further replies.