mike177 Posted February 17, 2008 Share Posted February 17, 2008 Hi, I am trubg to get the users email address out of the url. When they log in they are refirected to the index.php page from there they can go to the profile from the folloing link, [email protected]. now when they land on the profile page I want to echo there email (just as an example). I use just a simple echo $_GET['email']. But it's not working. any suggestions. Thanks for any help in advance. Link to comment https://forums.phpfreaks.com/topic/91466-urgent-_get/ Share on other sites More sharing options...
kenrbnsn Posted February 17, 2008 Share Posted February 17, 2008 That should work. Please post your script between tags. Ken Link to comment https://forums.phpfreaks.com/topic/91466-urgent-_get/#findComment-468570 Share on other sites More sharing options...
mike177 Posted February 17, 2008 Author Share Posted February 17, 2008 index.php <?php $email = $_COOKIE['email']; echo "[<a href=\"profile.php?email=$email\">My Profile</a>]" ?> profile.php <?php echo $_GET['$email']; ?> Thats all I have on the 2 pages. I no the cookies are set and working fine but when I try to get information from the url nothing happen's Link to comment https://forums.phpfreaks.com/topic/91466-urgent-_get/#findComment-468581 Share on other sites More sharing options...
kenrbnsn Posted February 17, 2008 Share Posted February 17, 2008 When you do <?php echo $_GET['$email']; ?> The variable is not expanded since you surrounded it with single quotes. Use: <?php echo $_GET[$email]; ?> Ken Link to comment https://forums.phpfreaks.com/topic/91466-urgent-_get/#findComment-468583 Share on other sites More sharing options...
PFMaBiSmAd Posted February 17, 2008 Share Posted February 17, 2008 Actually, it is not a variable. It should be the name of the parameter - $_GET['email'] Link to comment https://forums.phpfreaks.com/topic/91466-urgent-_get/#findComment-468586 Share on other sites More sharing options...
kenrbnsn Posted February 17, 2008 Share Posted February 17, 2008 My mistake. Yes that's right. Ken Link to comment https://forums.phpfreaks.com/topic/91466-urgent-_get/#findComment-468588 Share on other sites More sharing options...
mike177 Posted February 18, 2008 Author Share Posted February 18, 2008 Cheers that works a treat. Link to comment https://forums.phpfreaks.com/topic/91466-urgent-_get/#findComment-469328 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.