![]() |
Need some minor PHP help
Okay, i'm going to be sending people to a webpage with an "s" variable.
page.php?s=1 Now, on that page, i need another linking code to do some kind of "if" thing depending on what the value of s is. So, if s=1 in the URL to the page they user is currently on, then s in the link i'm creating will be, say, 12. And if s=2, then s in the link on the page will be 14. Make sense? Probably not! |
You could do something like
$s_values[1] = 12; $s_values[2] = 14; Then have something like $this_s_value = $s_values[$_GET["s"]]; That would make $this_s_value = whatever you have setup above. For example: If s = 1; The code I just had would basically make it like this. $this_s_value = $s_values[1]; // which is 12 Hope that makes sense and is what you want. Andy |
In PHP there is a SWITCH method... check it out
http://www.php.net/manual/en/control...res.switch.php *EDIT* not what you were looking for? Good reading anyways. |
Thanks guys. Just what i need. Cheers!
|
" "if" thing " ...hee hee, that was funny
|
Nice idea for filtering :thumbsup
|
Glad we could help.
|
Quote:
|
Quote:
|
| All times are GMT -7. The time now is 01:30 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123