Jump to content

submitting forms


ksmatthews

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.