|
-
Apr 22nd, 2006, 02:20 AM
#1
Thread Starter
Frenzied Member
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
Last edited by tony007; Apr 22nd, 2006 at 05:13 AM.
-
Apr 22nd, 2006, 05:11 AM
#2
<?="Moderator"?>
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/');
-
Apr 22nd, 2006, 05:13 AM
#3
Thread Starter
Frenzied Member
Re: How to redirect user browser to a specific page using php?
 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 :-(
-
Apr 24th, 2006, 06:44 PM
#4
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
-
Apr 24th, 2006, 07:08 PM
#5
Thread Starter
Frenzied Member
Re: How to redirect user browser to a specific page using php?
 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.
-
Apr 24th, 2006, 07:17 PM
#6
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');
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|