c_pattle Posted February 5, 2011 Share Posted February 5, 2011 Whenever I want to use AJAX (using jQuery) I store the PHP code in a seperate file and then send an retrieve data from that file using AJAX. However I was wondering if you can just call a PHP function. Then it would save me having to put each function in a seperate file? Thanks for any help. Link to comment https://forums.phpfreaks.com/topic/226839-calling-a-php-function-with-jquery/ Share on other sites More sharing options...
gizmola Posted February 5, 2011 Share Posted February 5, 2011 No. PHP runs serverside. Javascript runs clientside (inside the browser). Link to comment https://forums.phpfreaks.com/topic/226839-calling-a-php-function-with-jquery/#findComment-1170468 Share on other sites More sharing options...
kenrbnsn Posted February 6, 2011 Share Posted February 6, 2011 You don't have to put the PHP & Javascript in separate files, but you still need to obtain the results from PHP via Ajax. Ken Link to comment https://forums.phpfreaks.com/topic/226839-calling-a-php-function-with-jquery/#findComment-1170481 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.