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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 07-23-2004, 08:41 AM   #1
chodadog
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
chodadog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-23-2004, 08:46 AM   #2
AcidMax
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
AcidMax is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-23-2004, 08:46 AM   #3
Volantt
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

Last edited by Volantt; 07-23-2004 at 08:51 AM..
Volantt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-23-2004, 08:48 AM   #4
chodadog
Confirmed User
 
Join Date: Apr 2002
Posts: 9,736
Thanks guys. Just what i need. Cheers!
__________________
26 + 6 = 1
chodadog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-23-2004, 08:50 AM   #5
cfU
Confirmed User
 
Join Date: Jan 2003
Posts: 933
" "if" thing " ...hee hee, that was funny
cfU is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-23-2004, 08:50 AM   #6
Tom_PMs
Confirmed User
 
Join Date: Jun 2004
Posts: 2,049
Nice idea for filtering
__________________

You've read it, you can't unread it.
Tom_PMs is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-23-2004, 08:52 AM   #7
Volantt
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
Volantt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-23-2004, 09:01 AM   #8
chodadog
Confirmed User
 
Join Date: Apr 2002
Posts: 9,736
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.
__________________
26 + 6 = 1
chodadog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-23-2004, 09:06 AM   #9
cfU
Confirmed User
 
Join Date: Jan 2003
Posts: 933
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
cfU is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.