Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    TrainReq
    Guest

    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.

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,638
    Thanks
    2
    Thanked 404 Times in 396 Posts
    PHP Code:
    session_start();
    if(!isset(
    $_SESSION['current_number']))
         
    $_SESSION['current_number'] = 400;
    else
         
    $_SESSION['current_number']++; 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •