page redirect incrementally every 5 seconds

Discussion in 'PHP' started by gilgalbiblewheel, Apr 3, 2008.

  1. #1
    I have pages:
    page00001.php
    page00002.php
    page00003.php
    page00004.php
    page00005.php
    ...
    page00009.php
    page00010.php
    ...
    page00099.php
    page00100.php
    ...


    I want to make the page redirect incrementally every, let's say 5 seconds.
    How would I be able to achieve this?
    Once the number reaches 10 and 100 I have to drop a "0" from "page0000". $i represents the number of page to be changed incrementally.
    
    require_once('class_http.php');
    $h = new http();
    $i=2;
    $link = "http://.../new/page0000".$i.".htm";
    if (!$h->fetch($link)) {
      echo "<h2>There is a problem with the http request!</h2>";
      echo $h->log;
      exit();
    }
    $result = $h->body;
    PHP:
     
    gilgalbiblewheel, Apr 3, 2008 IP
  2. goldensea80

    goldensea80 Well-Known Member

    Messages:
    422
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    128
    #2
    This must be done in javascript, just google for javascript redirect and you will figure out how.
     
    goldensea80, Apr 3, 2008 IP
  3. Mr.Shawn

    Mr.Shawn Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Use meta redirect that will reside inside the <head> tags.
     
    Mr.Shawn, Apr 3, 2008 IP
  4. gilgalbiblewheel

    gilgalbiblewheel Well-Known Member

    Messages:
    435
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #4
    OK I know what I want.

    I need two things:
    1. Refresh the page every 5 seconds;
    2. by refreshing, the link (show below) has to change;
    require_once('class_http.php');
    $h = new http();
    $i = (isset($_GET['page']) ? intval($_GET['page']) : 1);
    $page = 'http://.../new/page' . str_pad ("$i",5,'0',STR_PAD_LEFT) . '.htm'; 
    if (!$h->fetch($page)) {
      echo "<h2>There is a problem with the http request!</h2>";
      echo $h->log;
      exit();
    }
    $result = $h->body; 
    PHP:
     
    gilgalbiblewheel, Apr 6, 2008 IP