/    Sign up×
Community /Pin to ProfileBookmark

one page or more for validation, error checking, etc.?

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

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@pyroDec 22.2003 — It's going to depend what you are trying to do, and what the script needs to achieve.
Copy linkTweet thisAlerts:
@kydo76authorDec 23.2003 — 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... : )
Copy linkTweet thisAlerts:
@pyroDec 23.2003 — 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.
Copy linkTweet thisAlerts:
@kydo76authorDec 23.2003 — 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
Copy linkTweet thisAlerts:
@pyroDec 23.2003 — Sure thing. ?
×

Success!

Help @kydo76 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...