Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP redirecting an HTML page? 1

Status
Not open for further replies.

capitano

Programmer
Jul 30, 2001
88
US
Hi all,

Does anybody know a way (a PHP command) to re-direct a visitor of your webpage to another webpage? In ColdFusion, I know you can re-direct the location of a user with:

<CFLOCATION URL=&quot;
When this is embedded in my HTML, it will instantly re-direct the user to newpage.cfm.

Is there a PHP equivalent of <CFLOCATION> ??

Thanks for any help!

Bryan
 
Hi

The above response from Joe is the best way, but if you have output something to the browser (and have no choice - not sure why that would be!!!) then you can use:

<?php
echo (&quot;<script>location='?>

This uses JavaScript to do the redirection and it will work even if you have sent output to the browser.

Cheers
Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top