By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,828 Members | 1,356 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,828 IT Pros & Developers. It's quick & easy.

how to redirect a webpage in php

P: 4
how to redirect a webpage in php
Jan 16 '07 #1
Share this Question
Share on Google+
6 Replies


acoder
Expert Mod 15k+
P: 16,027
[PHP]<?php
header('Location: http://www.yoursite.com/yourpage.php') ;
?>[/PHP]
This must appear before anything else on the page otherwise the redirect will not work.
Jan 16 '07 #2

ronverdonk
Expert 2.5K+
P: 4,258
I hope you mean 'any headers' or 'any output'.

Ronald :cool:
Jan 16 '07 #3

P: 2
NSR
I hope u meet ur requirement by this....


header("Location: ./to the page u like to ridirect");
Jan 17 '07 #4

acoder
Expert Mod 15k+
P: 16,027
I hope you mean 'any headers' or 'any output'.

Ronald :cool:
Yes, that's more precise.
Jan 17 '07 #5

P: 6
if you want redirect the page in your project then
<?php
header("location:yourpage.php");
?>

if you want redirect the page in another project then just put the url like

<?php
header("location:http://www.yoursite.com/yourpage.php");
?>
Jan 18 '07 #6

P: 2
You can find everything you need at
http://us2.php.net/header

good luck
ozgur uksal
Jan 18 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.