trying to call a php funcion from a library onclick using js
MrWhippy
3:00 pm on Aug 11, 2008 (gmt 0)
Hi all,
is it possible to call a php function from a library using javascript, i am trying to do this in a form, using the submit button.
any help much appreciated thanks.
Fotiman
5:56 pm on Aug 11, 2008 (gmt 0)
Yes and no. :)
You can't simply call a PHP function since PHP is processed server-side and JavaScript is processed client-side. You could, however, make an AJAX request to a PHP page, and have that PHP page return only the results of your function.
MrWhippy
6:43 pm on Aug 11, 2008 (gmt 0)
yeah i knew they worked differently i didnt want to put the script in its own page if you like i wanted it to be in a library,