how to manage a process php file?? i want every form which connected to database just use one php file..how to separate every command inside that php file??can i do that?
+3
A:
The easiest way is to have a hidden variable in each form. In the PHP processing page, you check for that variable, perhaps in a switch
statement and do the appropriate code there.
That being said, I don't recommend this method. It makes you add extra data and it makes the processing more complicated and confusing. I suggest having each page post to itself and operate off data there.
Kerry
2010-06-11 09:14:03
u mean that every form have one php processing file,aren't u?
klox
2010-06-11 09:17:18
That's what you asked, right? My recommendation is having every form submit to itself. The form is in a php file and so is the processing.
Kerry
2010-06-11 16:27:05
A:
Use a GET parameter (i.e. a querystring in the action) or a hidden input to specify which form has been submitted.
Ignacio Vazquez-Abrams
2010-06-11 09:14:15
Kerry said that it's so complicated and don't agree with my suggestion..is that true?
klox
2010-06-11 09:19:44
Of course it's complicated. But that's between you and whoever has to maintain your code after you, and the knife they hold in their hand as they hunt you down and kill you.
Ignacio Vazquez-Abrams
2010-06-11 09:31:36