error77
asked on
onclick execute php function
hi all,
I know how to run some javascript when I click on a link using onclick="runthis();" ... my question is ... how can I do this and run a php function instead?
thanks
I know how to run some javascript when I click on a link using onclick="runthis();" ... my question is ... how can I do this and run a php function instead?
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I didn't want to use ajax. I just wanted to run some php code when I click the onclick event link but don't need a return ... I would just add an alert saying "Done!" or something link that.
I actually need something simpler than that.
Thanks
I actually need something simpler than that.
Thanks
You can't directly. You need to post back to the server and call the function serverside. PHP is a server side language and javascript is typically a client side language. The client side script interacts with the page and the clientside DOM only. It doesn't interact with anything server side.
ASKER
I see why leakim971 was using Ajax then....hmm
Maybe you can tell what does that function and I could find a solution to use it - maybe... :-)
Cheers