View Full Version : Code in PHP
Aymen++
03-02-2003, 06:16 PM
I want a code in PHP that make me go to a specified page after several seconds...
Nightfire
03-02-2003, 06:36 PM
Use javascript or html...
<script>
function forwardpage(){
document.location='next.php';
}
setTimeout("forwardpage()",5000)
</script>
or
<meta HTTP-EQUIV=Refresh CONTENT="10; URL=next.php">
Spookster
03-02-2003, 07:52 PM
PHP cannot do this and nightfire has given you the proper client-side solutions. The meta tag solution is probably your best bet as it is crossbrowser and does not depend upon javascript being enabled.
As so I will move this to the HTML forum....
Yea the meta tag works better, but older browsers don't support that.
If the browsers support JavaScript, you can do this too:
<body onLoad=window.setTimeout("location.href='http://yourname.com'",5000)>
the 5000 meaning 5 seconds
Spookster
03-02-2003, 09:13 PM
Originally posted by Saj
Yea the meta tag works better, but older browsers don't support that.
yes they do
cg9com
03-03-2003, 07:55 PM
<meta> being first implemented in HTML 2
Spookster
03-03-2003, 09:02 PM
To be precise and avoid confusion it was first supported in Netscape Navigator 1.1 and Internet Explorer 2.0.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.