Form validation and page navigation 
Author Message
 Form validation and page navigation

Im new to PHP but not to web application development. I think I've
worked it out but I'd like to get some opinions on the best accepted
practice in PHP for the following:

I have a login page (login.php) that asks for a username and password
which I'll check behind the scenes. If they put a valid
username/password in I want to take them to the main menu page
(mainmenu.php).   If not, I want to put back the login page with a
suitable error (eg JavaScript alert)

I'm currently getting the login page to self reference and doing the
validation via a PHP script before the <html> tag, and redirecting
(using Location: mainmenu.php) if everything's OK

However that requires an extra HTTP request bounced off the browser.

This kind of form valiadtion is something I'll want to do everywhere
in the application, so is this the best technique or are there others?

ie the general case requirememt: submit the form, validate and either
go to the next page or put the form back on error

Any thoughts would be greatfully appreciated

---
Rob Tweed
M/Gateway Developments Ltd

Global DOMination with eXtc : http://www.*-*-*.com/
---



Fri, 22 Apr 2005 04:14:35 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. validation of entry fields, keyboard navigation of entries

2. Record Navigation in Form

3. How do you stop a page form printing on certain pages

4. Can't cancel page navigation in PyCom if IWebBrowser2

5. Page navigation

6. Page navigation in Tcl

7. Field Validation in a Form

8. Validation of FORM fields

9. HTML Form data validation with Object REXX (Windows)

10. Date validation of input from HTML form

11. newbie with a php validation form mail script problem

12. clientside validation of checkboxes from PHP form

 

 
Powered by phpBB® Forum Software