redirect

Javascript coding ..

Moderators: egami, macek, gesf

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

Thu Feb 20, 2003 12:38 pm

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

User avatar
Redcircle
Moderator
Moderator
Posts: 826
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

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">

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

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>

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

Mon Aug 29, 2011 7:56 am

@ Redcircle.....

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

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 0 guests