calling PHP function using onclick event

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
toraj58
Forum Newbie
Posts: 12
Joined: Sun Jun 15, 2008 12:40 am

calling PHP function using onclick event

Post by toraj58 »

i already know how to call a javascript function using onclick event of a button, but i encountered problem when i tried to call PHP function; how i can do it. is it possible or not?
User avatar
vargadanis
Forum Contributor
Posts: 158
Joined: Sun Jun 01, 2008 3:48 am
Contact:

Re: calling PHP function using onclick event

Post by vargadanis »

Hey,

this is possible but not simple. For that you need to use a technology called AJAX. Search for it on wikibooks.org and you will find quite a few good examples. If u are getting familiar with it you can use a library: prototypejs.
If you want to build ur own look it up on mozilla's dev site. There is an AJAX tutorial and they mention the differences bw. Gecko and IE.
Post Reply