Dimitris Papageorgiou
Dimitris Papageorgiou

Reputation: 447

code organisation

SO far, from my experience, in login scripts, I have to come to realize that the login form should be in the same script with the validation functions/code.

I mean the form action of the form and the validation will be in the same script. But what about when the user has checked also the "remember me" option?

Do you think that the user should be redirected to a different page(member's page)?

Or again, in one page? I mean one page in the first scenario, 2 pages in the second scenario.

Upvotes: 0

Views: 110

Answers (1)

Vlad Balmos
Vlad Balmos

Reputation: 3412

It's considered bad practice to code the form in the login script. Consider the scenario when a designer and a developer work togheter for redesigning the website. They can't both work on the same file at the same time. You should separate the code (business logic) from the presentation (html). You should have a script php that handles the auth process and the html form in a separate file.

Regarding "remember me" functionality, if the use has logged in using the login form, and checked the "remember me" checkbox, next time he visits the site, he should automatically be authenticated and redirected to the members page

Upvotes: 3

Related Questions