ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-general
php-general
RE: [PHP] php redirection..
by Brad Fuller other posts by this author
Dec 14 2006 8:42AM messages near this date
Re: [PHP] php redirection.. | RE: [PHP] php redirection..
Better to do this on the client side with JS

<html> 
<head> 
<title> Redirect Test</title>
<script language="JavaScript"> 
function redirect() {
	location.href='http://www.google.com/';
}
</script> 
</head> 
<body onLoad="setTimeout('redirect()', 3000);"> 
<p> You will be redirected in 3 seconds...</p>
</body> 
</html> 


>  -----Original Message-----
>  From: Youri LACAN-BARTLEY [mailto:ylacan@[...].com]
>  Sent: Thursday, December 14, 2006 10:44 AM
>  To: PHP General List
>  Subject: Re: [PHP] php redirection..
>  
>  Budi Setiawan wrote:
>  >> basically:
>  >>
>  >> cat.php
>  >>  -echo " test content<br>"
>  >>  -echo " more test content<br>"
>  >>
>  >> //redirect user
>  >>  echo"
>  >>   <script>
>  >>     location.href='foo.php';
>  >>   </script>
>  >>  ";
>  >>
>  >
>  >
>  > Hi , im a new too..
>  >
>  > but you can try with this to delay your script running for some seconds
>  :
>  > echo " test content<br>"
>  > echo " more test content<br>"
>  >
>  > // you can add :
>  > sleep(2);
>  > // this will cause your script delayed for 2 seconds
>  >
>  > //redirect user
>  > echo"
>  > <script>
>  > location.href='foo.php';
>  > </script>
>  > ";
>  >
>  
>  This would work providing you don't use output buffering, otherwise the
>  user won't see any data whatsoever that has been sent prior to the
>  sleep() call.
>  
>  >
>  > // hhaha..
>  > // im just trying to help...
>  > //
>  >
>  
>  --
>  PHP General Mailing List (http://www.php.net/)
>  To unsubscribe, visit: http://www.php.net/unsub.php
>  

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Thread:
Tim
Budi Setiawan
Youri LACAN-BARTLEY
Brad Fuller
Bruce
Brad Fuller
Bruce
Casey Chu
Casey Chu
Tedd
Youri LACAN-BARTLEY
Tim
Tim

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved