Forum Moderators: coopster

Message Too Old, No Replies

Calling PHP function with parameter from textbox

         

Jakotsu

7:49 pm on Oct 13, 2006 (gmt 0)

10+ Year Member



Hi, I have a PHP function like this:
function MyFunction($MyParam1,$MyParam2)

and I have to call it with the OnClick event from a button, sending the parameters which are the contents of 2 text boxes. What I need to know is exactly what to put on the OnClick event to call the function.

Thanks in advance.

coopster

10:16 pm on Oct 13, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



JavaScript runs on the client-side in the browser, not on the server-side. PHP is a server-side langauge. If you need to pass those values back to the server you are going to have to put them into your GET request (or POST if you are using a form) and perform a round-trip to the server.