Re: [PHP] Form call a function on submit
on 8/5/01 11:05 PM, Richard Kurth at [EMAIL PROTECTED] wrote: Is it possible to have a form submit button call a function. Like for updating a record in a database or for deleting data. Rather than a new page or with PHP_SELF i'm sure this isn't the only way, but what i do is... switch ($submit) { case my_value: my_function(); break; case my_other_value: my_other_function(); break; default: my_default_function(); break; } so, when the form is submitted, i check the value of submit and run the corresponding function. hope this helps, mike -- mike cullerton -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Form call a function on submit
Is it possible to have a form submit button call a function. Like for updating a record in a database or for deleting data. Rather than a new page or with PHP_SELF Best regards, Richard mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Form call a function on submit
AFAIK the function would always need to exist inside a php file. That file doesn't necessarily need to be a `page' (ie. print any HTML). Just make the ACTION of the form point to the file with your function in it (or a call to the function). Mick On Mon, 06 Aug 2001, Richard Kurth wrote: Is it possible to have a form submit button call a function. Like for updating a record in a database or for deleting data. Rather than a new page or with PHP_SELF Best regards, Richard mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Michael Hall mulga.com.au [EMAIL PROTECTED] ph/fax (+61 8) 8953 1442 ABN 94 885 174 814 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]