Page 1 of 1

Submit Form to PHP Function

Posted: Tue Jun 25, 2002 4:25 pm
by Junk Guy
Is there any way to submit a form to a PHP function rather than a page?

IE -
<FORM METHOD="POST" NAME="TESTFORM" ACTION="<? submitdata; ?>">

Thanks.

Posted: Tue Jun 25, 2002 4:30 pm
by Galahad
I'm pretty sure this is not possible because php is all server side. The browser (which posts the data) does not have access to php functions.

Posted: Wed Jun 26, 2002 1:41 am
by twigletmac
Galahad is right, PHP is server-side therefore you cannot access PHP functions (user defined or built in) without posting data to the server, refreshing the page or going to a new page. What you can do is submit the page to itself (look into $_SERVER['PHP_SELF']) and then have an if loop to check if the page has been submitted in order to run the code to validate the info or whatever. If you want pop-up boxes and such with warnings you need to use javascript which is client side.

So the answer to your question is no. Oh and please read this... (note point 2)

Mac