View Full Version : Which PHP page is better?

11-09-2006, 09:50 PM
When in doubt, ask the experts!

I had a question. Which 'type' of PHP pages are better, self-validating pages or passing the information to another page?

11-09-2006, 10:23 PM
"Better" in what way?
Depending on how you handle your forms either can be more convienient for you.
There is no real difference in performace/security.

11-09-2006, 10:55 PM
Ah ok.

I was just wondering. I have the habit of passing the information to another page. Like if I were making a login page, if it were better to use a self-validating page or opening up a new one. That's why I was asking.

11-10-2006, 03:35 AM
Using the same page makes it easier to redisplay the form along with error messages if there are errors in what was entered.

Using the same page also makes it harder to handle the situation where the data entered is valid as you have to check where the page was called from etc.

Which is better depends on how you see the tradeoff between these.

11-10-2006, 03:43 AM
I always use self-validating pages.. if statements are a programmers best friend! If you programming and make the pages neat and clean looking... its also easier to fix, addon and take off script from your pages.