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, pofile.php?email=master@hotmail.com. 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. Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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'] Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted February 17, 2008 Share Posted February 17, 2008 My mistake. Yes that's right. Ken Quote Link to comment Share on other sites More sharing options...
mike177 Posted February 18, 2008 Author Share Posted February 18, 2008 Cheers that works a treat. 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.