pass multiple variables in URL?
Moderator: General Moderators
- gregorious
- Forum Commoner
- Posts: 34
- Joined: Wed Aug 23, 2006 9:55 am
- Location: Orlando, FL
pass multiple variables in URL?
This is probably a no brainer for most of you.
I know how to pass one variable through a url, but how do I pass multiple variables?
This is a no go.
[ <a href='edit_residential_image.php?id=$id;&imageid=$imageid'><strong>edit</strong></a> ]
I need to pass image ID and the residential ID.
Thanks in advance for any help.
I know how to pass one variable through a url, but how do I pass multiple variables?
This is a no go.
[ <a href='edit_residential_image.php?id=$id;&imageid=$imageid'><strong>edit</strong></a> ]
I need to pass image ID and the residential ID.
Thanks in advance for any help.
- spamyboy
- Forum Contributor
- Posts: 266
- Joined: Sun Nov 06, 2005 11:29 am
- Location: Lithuania, vilnius
Here you go:
Code: Select all
example.php?oneVariable=something&secondVariable=something&thinrdVariable=something- webgroundz
- Forum Commoner
- Posts: 58
- Joined: Thu Jun 21, 2007 1:20 am
- Location: Philippines
here's another example :
i think you forgot to include the <?php ?> in your variable, it should be look like this:
instead of using = sign, you can use to print your variable.
<a href='edit_residential_image.php?
id =&imageid = '>redirect</a>

i think you forgot to include the <?php ?> in your variable, it should be look like this:
instead of using = sign, you can use
Code: Select all
<?php echo $id; ?><a href='edit_residential_image.php?
id =
Code: Select all
<?php =$id ?>Code: Select all
<?php =$imageid ?>- spamyboy
- Forum Contributor
- Posts: 266
- Joined: Sun Nov 06, 2005 11:29 am
- Location: Lithuania, vilnius
or...
Code: Select all
<?=$var?>- gregorious
- Forum Commoner
- Posts: 34
- Joined: Wed Aug 23, 2006 9:55 am
- Location: Orlando, FL
Thanks guys; that is a big help!
Here is the fix for future readers!
I have been reading else where that "&" is better than "&".
Thanks guys; that is a big help!
I have been reading else where that "&" is better than "&".
Code: Select all
[ <a href='edit_residential_image.php?id=$id&imageid=$imageid'><strong>edit</strong></a> ]- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
-
SidewinderX
- Forum Contributor
- Posts: 407
- Joined: Fri Jul 16, 2004 9:04 pm
- Location: NY
Re: Thanks guys; that is a big help!
Care to elaborate why or post that source?gregorious wrote:I have been reading else where that "&" is better than "&".
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Re: Thanks guys; that is a big help!
He is completely correct. & is the standard set by W3C. Don't believe me? Try to validate your HTML.SidewinderX wrote:Care to elaborate why or post that source?gregorious wrote:I have been reading else where that "&" is better than "&".