470,870 Members | 1,447 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,870 developers. It's quick & easy.

can a php function be called on submit

Hi

Is it possible to call a PHP function when a forms Submit button is pressed.

Thanks

AL
Jul 17 '05 #1
2 11338
Andy Levy wrote:
Hi

Is it possible to call a PHP function when a forms Submit button is
pressed.

Thanks

AL


If you mean on the same page, no. PHP is server side. It is parsed into HTML
/ whatever before it is sent to the client. The client never sees any PHP.
Now of course, you can pass the form data to another page on the server,
which can call whatever functions it wants to process the data...

// Ian Fette
Jul 17 '05 #2
"Andy Levy" <an*******@hotmail.com> wrote in message
news:<HF*****************@news-binary.blueyonder.co.uk>...

Is it possible to call a PHP function when a forms Submit
button is pressed.


Yes, if this function is in the script referred to in the form's
action attribute. No, if you want to call it when handling
onSubmit or onClick events -- those are handled on the client
side using JavaScript.

Cheers,
NC
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Justin Koivisto | last post: by
5 posts views Thread by siaj | last post: by
1 post views Thread by Sky Kim | last post: by
10 posts views Thread by ljlolel | last post: by
3 posts views Thread by Tanmaya Kulkarni | last post: by
11 posts views Thread by yangsuli | last post: by
6 posts views Thread by yawnmoth | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.