Javascript coding ..

Moderators: macek, egami, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 12
Joined: Wed Jan 22, 2003 2:47 am
Location: Norway


Post by jinx » Thu Feb 20, 2003 12:38 pm

how do I redirect to a page after 5 seconds? ..
Please give me the entire code

User avatar
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Post by 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=">

Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Post by 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>

New php-forum User
New php-forum User
Posts: 139
Joined: Mon Nov 15, 2010 12:11 am

Re: redirect

Post by lokanath7 » Mon Aug 29, 2011 7:56 am

@ Redcircle.....

in php it is also possible to redirect from one page to another...

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest