ksmatthews Posted March 17, 2008 Share Posted March 17, 2008 Hi Gurus, I am currently involved with a large php project that requires many php forms. My approach to POSTing data is to create ONE separate script that can be called by ALL the pages for back end data processing. An alternative approach of course is to create one back end processing script fpr each form but this can lead to coad bloat. It has recently been suggested to me that I might like to include the back end processing as part of the form script ... I am curious to know how other php developers do this ... * separate script per form, * backend processing within form script OR * one processing script that deals with multiple form POST resquests (as in my case) I would like to hear some opinions on this ... regards, Steven M Quote Link to comment Share on other sites More sharing options...
dbo Posted March 17, 2008 Share Posted March 17, 2008 It depends on the nature of the forms really. If they are all performing the same, or similar logic then a single entry point would be preferred. However, if the forms are pretty much unrelated, grouping the processing code into a single file doesn't make a lot of sense. Quote Link to comment Share on other sites More sharing options...
Acs Posted March 22, 2008 Share Posted March 22, 2008 I have a single file for each form I have but all the forms go to index2.php and it calls the correct file to process the data that is being sent to it. This is done before loading the form page. I just make a call to: systemManager::formProccessSet("path to form file"); And when index2.php is loaded it gets the file, it processes the data and then I just do a header("location to either the last page or to a previous set page (also done in the formproccessSet method) Quote Link to comment Share on other sites More sharing options...
Mastodont Posted March 23, 2008 Share Posted March 23, 2008 one processing script that deals with multiple form POST resquests I've got one processing class and separate "package" for each form. Package contains form skeleton, validation rules (required fields etc.), sql for dynamic data, action URL ... (still in development). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.