I am having some trouble passing varibles from one page to another... I am trying to pass them in the url like this: www.thisURL.com?$var1=foo?$var2=bar when i get to the other page i get: $var1 = foo?=bar. I am sick of using the explode() function.. Is there a work-around?
Thanks in Advance
1) don't use $ symbols in your URL. 2) after the file name, use a ?, and as a separator between each parameter, use a &.
Your example would then be:
www.thisURL.com?var1=foo&var2=bar
Hope that helps.
Thanks a million my friend... It always seems to be the smallest, easiest thing that works... especially after you have spent 15 hours working on a work-around. 🙂
Geoff
I'm trying to pass a variable to a form. I want this field that corresponds with this variable to be pre-filled.
If I use this URL
http://mysite.com/services.php?refid=spayce
Then I go to the form page what code do I need in the form page to ensure that the variable "refid" is carried over?
Will this work for you?
echo \"<INPUT TYPE=TEXT NAME=something VALUE=$refid>\n\";
or you can pass it as a hidden variable: echo \"<INPUT TYPE=HIDDEN NAME=something VALUE=$refid>\n\";