Link to home
Start Free TrialLog in
Avatar of Nilesh_K
Nilesh_K

asked on

Can we call a php function on html buttons onClick event?

I am Suffering fom a problem.
i want to execute particular php code when a button is clicked . So i write a function and called on the onclick event of a Button. But it wont Work.As in Java Script we can call javascript Function on the onclick event.Thats why i try it.
Please Help me if any can........      

                                                Nilesh_K
Avatar of carchitect
carchitect

what are you trying to do nitish i hope i can help you, pls post your complete query, this is kapil.
regards
The short answer is that you cannot directly call a PHP script from an HTML page as you can a JavaScript.  The reason is that PHP is a server side script language, while JavaScript is client side.

With that said, there are a couple of possible work arounds depending on what you are trying to do.  Could you give me a little more information about what you are trying to accomplish?

-Peter
ASKER CERTIFIED SOLUTION
Avatar of Jonza
Jonza

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Nilesh_K

ASKER

Thanks Joza it is a great Idea.
You Help me allot thanks once again
 
no problem =)
Nilesh please accept Jonza's comment and the answer.