|
|
|
||||
|
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() |
|
|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
|
Thread Tools |
|
|
#1 |
|
Confirmed User
Join Date: Apr 2002
Posts: 9,736
|
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!
__________________
26 + 6 = 1 |
|
|
|
|
|
#2 |
|
Confirmed User
Join Date: May 2002
Location: MI
Posts: 1,827
|
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
__________________
Latest MMA news. http://www.mmawrapup.com |
|
|
|
|
|
#3 |
|
Confirmed User
Join Date: Nov 2003
Location: Penguin vs Devil
Posts: 745
|
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.
__________________
"Only the dead have seen the end of war." - Plato "In the abscence of orders, go find something and kill it." - Erwin Rommel "A man's worth is no greater then the worth of his ambitions." - Marcus Aurelius |
|
|
|
|
|
#4 |
|
Confirmed User
Join Date: Apr 2002
Posts: 9,736
|
Thanks guys. Just what i need. Cheers!
__________________
26 + 6 = 1 |
|
|
|
|
|
#5 |
|
Confirmed User
Join Date: Jan 2003
Posts: 933
|
" "if" thing " ...hee hee, that was funny
|
|
|
|
|
|
#6 |
|
Confirmed User
Join Date: Jun 2004
Posts: 2,049
|
Nice idea for filtering
|
|
|
|
|
|
#7 |
|
Confirmed User
Join Date: Nov 2003
Location: Penguin vs Devil
Posts: 745
|
Glad we could help.
__________________
"Only the dead have seen the end of war." - Plato "In the abscence of orders, go find something and kill it." - Erwin Rommel "A man's worth is no greater then the worth of his ambitions." - Marcus Aurelius |
|
|
|
|
|
#8 | |
|
Confirmed User
Join Date: Apr 2002
Posts: 9,736
|
Quote:
__________________
26 + 6 = 1 |
|
|
|
|
|
|
#9 | |
|
Confirmed User
Join Date: Jan 2003
Posts: 933
|
Quote:
|
|
|
|
|