Problem in Refreshing AJAX, PHP & MySQL

Discussion in 'PHP' started by bartolay13, Nov 6, 2007.

  1. #1
    hello again,

    i am having a problem on refreshing my page dynamically...
    i have an administrator page that will monitor all the records in the database,
    and the

    
    function redirect($time, $topage) 
    { 
    echo "<meta http-equiv=\"refresh\" content=\"{$time}; url={$topage}\" /> "; 
    }
    where
    redirect(0,"same page");
    
    PHP:
    the page runs through AJAX
    thanks in advance...
     
    bartolay13, Nov 6, 2007 IP
  2. bobb1589

    bobb1589 Peon

    Messages:
    289
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    get rid of the brackets in the content... and whats the where for?
     
    bobb1589, Nov 6, 2007 IP
  3. garbageman

    garbageman Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Brackets are supposed to be there, they are enclosing a function.
    The where clause should be scrapped. If you are trying to put in the same page, you can use
    redirect(0, $_SERVER['REQUEST_URI']);

    Besides those syntax errors, I really don't understand your problem, elaborate.
     
    garbageman, Nov 6, 2007 IP
  4. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #4
    oh sori about the where

    i call on my function redirect to my script where the script undergoes
    AJAX then to my index administrator page..

    this page must update whenever a record has been change in the database.
    and one thing i can think of is to refresh the same page in order to synchronize the changes...

    theres no error on the script, but the page doesnt seem to update...
     
    bartolay13, Nov 6, 2007 IP
  5. bobb1589

    bobb1589 Peon

    Messages:
    289
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #5
    ive never had to use them before...
     
    bobb1589, Nov 6, 2007 IP
  6. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #6
    anyways
    about the page refreshing.
    i still havent got the right code for this one,,


    i also used
    document.refresh
    in JS still not working

    any answers from our masters.? = )
     
    bartolay13, Nov 6, 2007 IP
  7. bobb1589

    bobb1589 Peon

    Messages:
    289
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #7
    instead of making a function why not just echo the meta refresh straight in the page?
     
    bobb1589, Nov 7, 2007 IP