Forum Moderators: coopster

Message Too Old, No Replies

refresh page with php

how do you get php to refresh the page

         

mhbweb

9:25 pm on Sep 23, 2004 (gmt 0)

10+ Year Member



Hi all,

was wondering how you would get the browser to update the data in a table, would it be possible to have PHP refresh the whole page?

just a thought.. thx for your support.

StupidScript

11:31 pm on Sep 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



PHP is all gone by the time the browser receives the page, as it is server-side only. Any PHP you put on the page will be parsed and replaced before delivery. You'd need to refresh the page as a result of a user action (i.e. click link/button) or using something like Javascript to force a reload based on an action or a timeframe.

Timotheos

3:05 am on Sep 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Why not just use a meta refresh?

<META HTTP-EQUIV="Refresh" CONTENT="10; URL=index.php">

jamie

10:25 am on Sep 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



mhbweb,

why don't you use a header() command after the update has been successful?

// do SQL update query

// check that the update was a success
if (mysql_affected_rows() > 0)
{
// reload page
header("Location: " . $_SERVER['PHP_SELF']);
}

this will simply reload the page you are on.

does that help?