I have a small application in which i have 9 different forms, and every form have a least 40+ fields where the user must enter some data.
I have written each form in a single php file and made a master PHP file where i only add the form in the middle of the page.
My question is:
I don't want to write 9 different function for each form coz it would be too long and i don't think it's the best practice, so is there a way or idea that can help me make a general function in which i can pass some variables to and add the data to the db.
Can i like iterate through the $_POST array and extarct the data and reformat it somehow? but then again every field have a different name and i seems like this is impossible to do.