Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Redirect after registering
Old 08-11-2008, 01:00 AM Redirect after registering
Truly's Avatar
Ultra Talker

Posts: 322
Trades: 0
Right now I have a registration page that has the user fill out a whole bunch of information and when they hit submit it reloads the same page but gets picked up by PHP for validation and to add the information to the database. If there is a problem it just echos the fact that there is a problem and then displays the html form again to correct the problems, otherwise I want it to redirect to another page. My question, how do I best go around having it redirect to that other page? Should I just use 'include' and actually keep it on the same page?
__________________
DVD Movie Release Database:
Please login or register to view this content. Registration is FREE
Truly is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-11-2008, 08:04 AM Re: Redirect after registering
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
The way to do a redirect is with a header like this:
PHP Code:
header("Location: http://www.mywebsite.com/my/new/location.php"); 
This needs to happen before any HTML is outputted, like the document type or any other header information.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 08-11-2008, 11:08 AM Re: Redirect after registering
Truly's Avatar
Ultra Talker

Posts: 322
Trades: 0
Is that efficient? Is that the way that most sites do it when they are done validating on one page?
__________________
DVD Movie Release Database:
Please login or register to view this content. Registration is FREE
Truly is offline
Reply With Quote
View Public Profile
 
Old 08-11-2008, 11:39 AM Re: Redirect after registering
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
It is accomplished using a standard http header. Every web programming language has its own built in functions for sending the exact same header via the standard http header protocol. It is the best way to do redirects without breaking the back button, and causes no noticeable delays whatsoever.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 08-11-2008, 01:11 PM Re: Redirect after registering
Truly's Avatar
Ultra Talker

Posts: 322
Trades: 0
Awesome thanks for the help!
__________________
DVD Movie Release Database:
Please login or register to view this content. Registration is FREE
Truly is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Redirect after registering
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15542 seconds with 12 queries