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. Quote Link to comment 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). Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.