Board index   FAQ   Search  
Register  Login
Board index php forum :: HTML JavaScript

redirect

Javascript coding ..

Moderators: macek, egami, gesf

redirect

Postby jinx » Thu Feb 20, 2003 12:38 pm

how do I redirect to a page after 5 seconds? ..
Please give me the entire code
jinx
New php-forum User
New php-forum User
 
Posts: 12
Joined: Wed Jan 22, 2003 2:47 am
Location: Norway

Postby Redcircle » Thu Feb 20, 2003 12:51 pm

search the internet for javascript redirects or header redirects. PHP cannot do it.

with a header redirect put this within the <head>

<meta http-equiv="refresh" content="5;url=http://yourdomain.com">
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby Oleg Butuzov » Fri Feb 21, 2003 12:32 am

Code: Select all
<script language="JavaScript">
<!--
t=1; function dorefresh() { u=new String("<?=$URL;?>");
ti=setTimeout("dorefresh();",5000); if (t>0) { t-=1; }
else { clearTimeout(ti); window.location=u.replace("#","&t="+parseInt(10000*Math.random())+"#"); }
} window.onLoad=dorefresh();
//--></script><noscript><meta http-equiv="Refresh" content="1; URL=<?=$URL;?>"></noscript>
Oleg Butuzov
Last Samuray
Last Samuray
 
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Re: redirect

Postby jacobsmith » Mon Jul 18, 2011 9:39 pm

Hi try this coding,It's very simple

<?php
header('Refresh:3; url=index.php');
?>

Cegonsoft Training Methodology
jacobsmith
New php-forum User
New php-forum User
 
Posts: 2
Joined: Mon Jul 18, 2011 8:55 pm

Re: redirect

Postby lokanath7 » Mon Aug 29, 2011 7:56 am

@ Redcircle.....

in php it is also possible to redirect from one page to another...
lokanath7
New php-forum User
New php-forum User
 
Posts: 139
Joined: Mon Nov 15, 2010 12:11 am


Return to JavaScript

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.