Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

php

Options
  • 30-10-2007 4:46pm
    #1
    Closed Accounts Posts: 114 ✭✭


    is it better to post a form to the page containing the form for validation or to another seperate page? Also are there any good examples of form validation and error message placement that people like in existing forms?


Comments

  • Registered Users Posts: 6,509 ✭✭✭daymobrew


    I recently started using the Form Mailer from Tectite.com. It's quite a monster at over 300k of PHP!

    I don't know of any advantages or disadvantages of keeping the form and response code together. In my case multiple pages use the one php script.


  • Closed Accounts Posts: 5,029 ✭✭✭um7y1h83ge06nx


    Check out Quickform, a PEAR extension for PHP that provides methods for creating, validating, processing HTML forms..

    Here it is in action, along with Smarty and Overlib: http://www.phcomp.co.uk/TechTutorial/QfSmarty/index.php

    And here is the download for it: http://pear.php.net/package/HTML_QuickForm/redirected

    And just in case you haven't installed PEAR extensions before: http://pear.php.net/manual/en/installation.cli.php

    Hope this helps.


  • Closed Accounts Posts: 8,478 ✭✭✭GoneShootin


    is it better to post a form to the page containing the form for validation or to another seperate page?

    Short answer is that it doesn't really matter - no option has inherit advantages over the other. It depends more on the context of the form and how you want to results of submittal to be displayed.


  • Registered Users Posts: 6,509 ✭✭✭daymobrew


    Aside: OP - in future please provide a more detailed title to your thread.
    For this thread, "PHP forms - separate file or same file?" would have been quite clear.

    http://www.catb.org/~esr/faqs/smart-questions.html#bespecific


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    If anybody has a problem with a user, a post or a thread on this forum can they report it to the forum moderators please? *daymobrew*

    thank you.


  • Advertisement
  • Closed Accounts Posts: 583 ✭✭✭monkey tennis


    is it better to post a form to the page containing the form for validation or to another seperate page?

    Usually little more than a personal preference. For example, I usually prefer to keep the form processing code in the same file as the form code itself, for neatness. If the code is complex, or the processing form is to be reused for other forms, it might make more sense to keep it as a seperate file.


Advertisement