How to redirect user browser to a specific page using php?
Hi all . i wonder how i can redirect a visitor of my webpage to specified page ? What i mean suppose some one visits a page in my webiste and i am admin want to direct his webbrowser to a page like www.cnn.com . i be happy if an expet show me how that can be done.Thanks
Re: How to redirect user browser to a specific page using php?
use the header() function to do this.
PHP Code:
header('location: http://www.vbforums.com/');
Re: How to redirect user browser to a specific page using php?
Quote:
Originally Posted by john tindell
use the
header() function to do this.
PHP Code:
header('location: http://www.vbforums.com/');
how to do this dynamically and diffrent for each user currently visting my page ? what i mean push page .That is what i was looking :-(
Re: How to redirect user browser to a specific page using php?
You would have to have a pre-defined list of sites that each user would be re-directed to so when you check which user is accessing your page they automatically get re-directed to the correct page.....HTH :)
Re: How to redirect user browser to a specific page using php?
Quote:
Originally Posted by lintz
You would have to have a pre-defined list of sites that each user would be re-directed to so when you check which user is accessing your page they automatically get re-directed to the correct page.....HTH :)
lol. Thans for u reply. Storing the url list is not problem i can do that in db but the issue is how to send the url for perticuler visitor and it pops up in his browser!! That is the trick . It is very nice thing but i did not figure it out yet. I hope some one show me a good reliable solution for it.
Re: How to redirect user browser to a specific page using php?
Do what John posted.
PHP Code:
//User accesses your page
//Get user details from db including URL that user should be redirected to
//Redirect user
header('location: $UserURL');