Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-25-2008, 10:23 AM   PM User | #1
TrainReq
Guest

 
Posts: n/a
Increase number per refresh

Say if i wanted to echo a number starting at 400 , then every time I refresh it goes 401 , 402 , 403 , etc. How would I go about doing that? The way I would think about it going is it will set a session saying "current number is 400" , then on refresh it will basically say "if number is 400 , go to 401 , if number in session is 401 set the session 402 , and echo the number 402 , if the number in session is 402 , then set the session to 403 , etc and on up" , but how could I do that.

Last edited by TrainReq; 02-25-2008 at 10:26 AM..
  Reply With Quote
Old 02-25-2008, 02:07 PM   PM User | #2
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,601
Thanks: 2
Thanked 397 Times in 390 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
PHP Code:
session_start();
if(!isset(
$_SESSION['current_number']))
     
$_SESSION['current_number'] = 400;
else
     
$_SESSION['current_number']++; 
Inigoesdr is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:05 AM.


Advertisement
Log in to turn off these ads.