ltoto Posted September 15, 2006 Share Posted September 15, 2006 [code]"{$_SERVER['PHP_SELF']}?Id=16?id={$row['Id']}">{$row['regionName']}[/code]so as you can see i have 2 ids on one line,because i want it to first go to index.php?Id=16, because this is what page i want it to appear on, and then on that page i want id={$row['Id']}">{$row['regionName'] this bit to show up. Quote Link to comment Share on other sites More sharing options...
AndyB Posted September 15, 2006 Share Posted September 15, 2006 You can pass as many variables as you want in a link but if you pass the same named variable twice how would the following script know what was going on. If you want to pass the value of Id twice then give it a different name in the link and in the following script abstract that second value and do whatever you want with it ...[code] href='...?Id=16&fake_Id=whatever&another_Id=something .... [/code]Note that the ampersand is used to pass parameters after the first. Quote Link to comment Share on other sites More sharing options...
ltoto Posted September 15, 2006 Author Share Posted September 15, 2006 im a little bit confused by what you mean by that, or maybe im missing somethign when i am reading it Quote Link to comment Share on other sites More sharing options...
AndyB Posted September 15, 2006 Share Posted September 15, 2006 Simplifying ...When you want to pass more than one variable in a link, use the ampersand as the separator for all links after the first:[code] ....filename.php?x=1&y=2&z=3&myname=wombat[/code]You can't pass two [i]different[/i] values for the [i]same[/i] variable. The code below is nonsense:[code] ....filename.php?x=1&x=2&x=3&x=wombat[/code] Quote Link to comment Share on other sites More sharing options...
ltoto Posted September 15, 2006 Author Share Posted September 15, 2006 ahhh i think i understnad now, i think the only bit that confuses me is what i put before the 2nd id Quote Link to comment Share on other sites More sharing options...
AndyB Posted September 15, 2006 Share Posted September 15, 2006 ?Id=16[b]&[/b]id={$row['Id'] ... I'd be very careful with id and Id to make sure you don't confuse yourself and/or confuse the script that's trying to process the data Quote Link to comment Share on other sites More sharing options...
ltoto Posted September 15, 2006 Author Share Posted September 15, 2006 ahh yes, i accidently missed the first Id out which was confusing me, but it is working fine now, thanks a lot man Quote Link to comment 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.