|
Posted by Sanders Kaufman on 11/21/06 19:15
Auddog wrote:
> After starting to work with PHP, I have a question on others programming
> preferences. I usually create multiple pages for user input, 1 page for the
> form and 1 page for the insert and then a redirect. I have noticed thru
> several tutorials on the web that most are created pointing back to
> themselves
>
> I.E.
> if(isset($_post['submitted'])) {
>
> Is there a preferred way? Other than the obvious, it's all on one page, is
> there other benefits to the one page setup?
Either way is just fine.
I like to put it all in ONE file for manageability
and to avoid spaghetti code.
In some cases, I use separate files to reduce server
load. For example, I'll have a static HTML page
that contains the form, and then it submits to a PHP
page to process the data. That way, even if a
zillion people view the form - only the ones who
actually submit it will use the additional server
load required to process PHP.
Navigation:
[Reply to this message]
|