GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Need some minor PHP help (https://gfy.com/showthread.php?t=330162)

chodadog 07-23-2004 08:41 AM

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!

AcidMax 07-23-2004 08:46 AM

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

Volantt 07-23-2004 08:46 AM

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.

chodadog 07-23-2004 08:48 AM

Thanks guys. Just what i need. Cheers!

cfU 07-23-2004 08:50 AM

" "if" thing " ...hee hee, that was funny

Tom_PMs 07-23-2004 08:50 AM

Nice idea for filtering :thumbsup

Volantt 07-23-2004 08:52 AM

Glad we could help.

chodadog 07-23-2004 09:01 AM

Quote:

Originally posted by cfU
" "if" thing " ...hee hee, that was funny
Hey, gimme a break. I ain't down with all that technical jive! haha.

cfU 07-23-2004 09:06 AM

Quote:

Originally posted by chodadog
Hey, gimme a break. I ain't down with all that technical jive! haha.
hahaha, jk bro - just made me chuckle


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