cuds Posted January 16, 2008 Share Posted January 16, 2008 Hi i am trying to get this index.php page to refresh every 60 seconds i am new to php so kind of used the meta tag in header code to do it , what i need to know is if this is right and on loading the other 3 php require_once ("include/functions.php"); require_once ("include/config.php"); require_once ("include/blocks.php"); If after 60 seconds it would refresh them for me again Any help would be great Heres the code <?php // refresh / re-direct to index // ——————————— header( ‘refresh: 60; url=http://mysite.com’ ); ?> <?php /******** Do not remove the Copyright in footer! ********/ if (file_exists("install.me")) { if (dirname($_SERVER["PHP_SELF"])=="/" || dirname($_SERVER["PHP_SELF"])=="\\") header("Location: http://".$_SERVER["HTTP_HOST"]."/install/"); else header("Location: http://".$_SERVER["HTTP_HOST"].dirname($_SERVER["PHP_SELF"])."/install/"); exit; } require_once ("include/functions.php"); require_once ("include/config.php"); require_once ("include/blocks.php"); dbconn(true); standardheader('Index',true,0); center_menu(); /* if (!$CURUSER || $CURUSER["view_torrents"]=="no") { err_msg(ERROR.NOT_AUTHORIZED." ".MNU_TORRENT."!",SORRY."..."); stdfoot(); exit(); } else { */ ?> <script language="Javascript" type="text/javascript"> <!-- var newwindow; function popdetails(url) { newwindow=window.open(url,'popdetails','height=500,width=500,resizable=yes,scrollbars=yes,status=yes'); if (window.focus) {newwindow.focus()} } function poppeer(url) { newwindow=window.open(url,'poppeers','height=400,width=650,resizable=yes,scrollbars=yes'); if (window.focus) {newwindow.focus()} } // --> </script> <?php //} stdfoot(); ?> Quote Link to comment https://forums.phpfreaks.com/topic/86234-php-refresh/ Share on other sites More sharing options...
trq Posted January 16, 2008 Share Posted January 16, 2008 If you weren't using wierd quotes it should work. header("refresh: 60; url=http://mysite.com"); Just as easy to stick with a meta refresh though. Quote Link to comment https://forums.phpfreaks.com/topic/86234-php-refresh/#findComment-440538 Share on other sites More sharing options...
cuds Posted January 16, 2008 Author Share Posted January 16, 2008 Thanks thorpe but isnt my code Any chance you can paste the code up for me but in the right place so i can see what you did and try to learn it better I understand if it was in html but not php Thanks Quote Link to comment https://forums.phpfreaks.com/topic/86234-php-refresh/#findComment-441396 Share on other sites More sharing options...
cuds Posted January 16, 2008 Author Share Posted January 16, 2008 Wouldnt allow me to modify my post but this is what i would put in the headers in html <META HTTP-EQUIV="refresh" CONTENT="60"> The thing is where would i put it in the above to make it work <?php /******** Do not remove the Copyright in footer! ********/ if (file_exists("install.me")) { if (dirname($_SERVER["PHP_SELF"])=="/" || dirname($_SERVER["PHP_SELF"])=="\\") header("Location: http://".$_SERVER["HTTP_HOST"]."/install/"); else header("Location: http://".$_SERVER["HTTP_HOST"].dirname($_SERVER["PHP_SELF"])."/install/"); exit; } require_once ("include/functions.php"); require_once ("include/config.php"); require_once ("include/blocks.php"); dbconn(true); standardheader('Index',true,0); center_menu(); /* if (!$CURUSER || $CURUSER["view_torrents"]=="no") { err_msg(ERROR.NOT_AUTHORIZED." ".MNU_TORRENT."!",SORRY."..."); stdfoot(); exit(); } else { */ ?> <script language="Javascript" type="text/javascript"> <!-- var newwindow; function popdetails(url) { newwindow=window.open(url,'popdetails','height=500,width=500,resizable=yes,scrollbars=yes,status=yes'); if (window.focus) {newwindow.focus()} } function poppeer(url) { newwindow=window.open(url,'poppeers','height=400,width=650,resizable=yes,scrollbars=yes'); if (window.focus) {newwindow.focus()} } // --> </script> <?php //} stdfoot(); ?> Quote Link to comment https://forums.phpfreaks.com/topic/86234-php-refresh/#findComment-441421 Share on other sites More sharing options...
teng84 Posted January 16, 2008 Share Posted January 16, 2008 you can put that inside the head tag of your html! Quote Link to comment https://forums.phpfreaks.com/topic/86234-php-refresh/#findComment-441428 Share on other sites More sharing options...
cuds Posted January 17, 2008 Author Share Posted January 17, 2008 Thanks teng but thats the problem it isnt index.htm its index.php Please note it isnt a webpage but a php page what i am trying to say is where the heck in that code i posted would i insert it so it works and doesnt screw it up Sorry i didn't make it any clearer Quote Link to comment https://forums.phpfreaks.com/topic/86234-php-refresh/#findComment-441828 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.