Page 1 of 1
php variables in url link
Posted: Fri Jan 29, 2010 2:39 pm
by midohioit
I know you can do one variable in a link like the following:
<a href="test.php?variable1=xyx">link to other page</a>
is there a way to do more then one variable? so i also want to do variable2 ...
Re: php variables in url link
Posted: Fri Jan 29, 2010 2:52 pm
by dimxasnewfrozen
One way is:
<a href="test.php?variable1=" . $var1 ."&variable2=" . $var2 .">link to other page</a>
All you have to do is add the & in between each variable you're assigning
Re: php variables in url link
Posted: Fri Jan 29, 2010 3:16 pm
by josh
Re: php variables in url link
Posted: Fri Jan 29, 2010 3:26 pm
by AbraCadaver
If you want your page to validate you'll need to use & instead of & regardless.
Re: php variables in url link
Posted: Fri Jan 29, 2010 7:49 pm
by midohioit
AbraCadaver and others thank you. That fixed my problem. I could not use sessions I had to do it with url because the client wanted to bookmark the page and be able to send it to others. if i did it with sessions then it would not have stored info in a helpful way for this. The issue was solved with your help. I appriciate your feedback.
Re: php variables in url link
Posted: Fri Jan 29, 2010 7:50 pm
by midohioit
how do you mark this post as "solved" ?