Results 1 to 9 of 9
Dec 18, 2011, 23:01 #1
- Join Date
- Aug 2010
- 2 Post(s)
- 0 Thread(s)
Where do I go after "Create an Account"??
I have a "Create an Account" PHP page.
Assuming the form data is valid, where should control go when the User submits the Form??
1.) Redirect to a New Page?
2.) Load the Page Onto Itself?
My 1st Approach
HTML to Open Page If Form Submitted, then... PHP to handle Form If Account Created, echo HTML with Success Message and Close Out Page with HTML If Account Failed, echo HTML with Failure Message and Close Out Page with HTML else, drop through to HTML Form and Closing HTML
My 2nd Approach
If Form Submitted, then... PHP to handle Form If Account Created, code=111 and Redirect to "Outcome Page" which looked up 111 and displayed appropriate message If Account Created, code=222 and Redirect to "Outcome Page" which looked up 222 and displayed appropriate message else, drop through to HTML Form and Closing HTML
I still feel like this 2nd approach is kinda "hokey" and could use help coming up with a better approach.
(Before going on, let me say I am not ready to learn OOP or MVC, so please keep solutions to plain-vanilla, procedural coding.)
I have heard that using Redirects is a good idea, but I'm just thinking that having this "Outcome Page" is kinda weird.
The 2nd approach is working okay, but I'm sure it could be better...