ainoy31 Posted January 21, 2008 Share Posted January 21, 2008 Hello- I am sending emails with a hyperlink in the body where my users can click on and it will take them to a certain page. $body .= "http://xxx.php?y=$id"; Is there a way not to make the $id value visible? Meaning, in the email they see $body .= "http://xxx.php?y=100"; Much appreciation. Quote Link to comment https://forums.phpfreaks.com/topic/87124-solved-passing-values-in-the-url/ Share on other sites More sharing options...
Daniel0 Posted January 21, 2008 Share Posted January 21, 2008 That is how it will work as long as you use double quotes. Quote Link to comment https://forums.phpfreaks.com/topic/87124-solved-passing-values-in-the-url/#findComment-445568 Share on other sites More sharing options...
ainoy31 Posted January 21, 2008 Author Share Posted January 21, 2008 I am trying to see how this is for me. I want my users not to see the value of the id when they click on the link in their email. So, right now they see http://xxx.php?y=100"; but I need it to be http://xxx.php?y=$id"; Quote Link to comment https://forums.phpfreaks.com/topic/87124-solved-passing-values-in-the-url/#findComment-445574 Share on other sites More sharing options...
Daniel0 Posted January 21, 2008 Share Posted January 21, 2008 Then just use single quotes. In that way they won't be interpolated (i.e. the variables will not be replaced with their values). Quote Link to comment https://forums.phpfreaks.com/topic/87124-solved-passing-values-in-the-url/#findComment-445576 Share on other sites More sharing options...
Daleeburg Posted January 21, 2008 Share Posted January 21, 2008 i beleive what you are doing is trying to hid the value of $id when they hit up your site. The problem is that the way you are trying to do it is not possible because of how php is processed. Everything is done at run time, so the $id variable will only exist for the few seconds that it takes to run the script, after that it is gone and not longer exist. The value of it also disappears. This is why you can use the same variable on 2 different pages and not have to worry about cross contamination. If you are trying to hid the value from them, you may be best to set up a SQL table that looks at the unique identifier and then grabs the variable out of there. You would still have to pass the user name, or some other unique identifier, in the link, but it would not have to be what you do not want them to see. ~D Quote Link to comment https://forums.phpfreaks.com/topic/87124-solved-passing-values-in-the-url/#findComment-445580 Share on other sites More sharing options...
ainoy31 Posted January 24, 2008 Author Share Posted January 24, 2008 The work around what I need is that I pass three variables in the URL and then check to make sure that all three values correspond to each other. Meaning if I had www.xxx.com/xxx.php?a=$id&b=$em&c=$pn, someone can not say just change one of the variables and access other quotes. Quote Link to comment https://forums.phpfreaks.com/topic/87124-solved-passing-values-in-the-url/#findComment-447832 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.