Click to See Complete Forum and Search --> : one page or more for validation, error checking, etc.?
kydo76
12-22-2003, 05:29 PM
let's say i have a logon script. Would it be better to have all the code on one page where it would do all the checking for errors, validation, database access, etc, or would it be better to have a separate page doing all that good stuff or would it be better to split up the work between the pages? also, if possible advantages? disadvantages?
thanx
It's going to depend what you are trying to do, and what the script needs to achieve.
kydo76
12-23-2003, 05:56 AM
basically i'm looking for a general rule of thumb maybe? for how to handle situations? like...
1) logon page where it checks the login and password with the database, sends out error messages, etc
and
2) like a registration form where it would validate email addresses, phone numbers etc... also if all non-optional fields are required
or any other examples u might be able to think of... i just wanna know when would it be a good time to write a script that would call itself or to have another page calling the scripts.... thanx... : )
I those examples, I would probably have it call itself, but again, it depends on what you are logging in to, etc. The main reason I would use the same page is that when you do data validation, you can re-input their data into the form, should they type something incorrectly. Take the registration example. If you needed a large amount of information (or even not the much), users will appreciate having the info that they correctly specified re-inserted, should you need to display an error message. That way, they only need to change the one specified field, rather than the entire form again.
kydo76
12-23-2003, 03:55 PM
haha... ok.. : ) i guess i just need to get more experience working with these kinds of things.. and see how they work out... i just wanted opinions.... thanks for the responses