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 ...
php variables in url link
Moderator: General Moderators
-
dimxasnewfrozen
- Forum Commoner
- Posts: 84
- Joined: Fri Oct 30, 2009 1:21 pm
Re: php variables in url link
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
<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
http://us3.php.net/http_build_query
or PHP SESSIONS
or PHP SESSIONS
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: php variables in url link
If you want your page to validate you'll need to use & instead of & regardless.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: php variables in url link
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
how do you mark this post as "solved" ?