View Single Post
  #1 (permalink)  
Old October 21st, 2007, 08:35 AM
crmpicco crmpicco is offline
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default php take get variable and dynamically set values

Code:
if ($page == 2) {
  $minimum = 10;
  $maximum = 20;
} else {
  $minimum = 0;
  $maximum = 10;
}
I have a variable "$page" in my script, if I $page is 3 then the minimum and maximum values would need to be 20 and 30 respectively. Is there a way I can amend the code above to make it more dynamic that just purely having if statements catching the $page value and setting the values as I am just now?

Any help is very much appreciated,
Picco


www.crmpicco.co.uk
www.ie7.com
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk