devilinc Posted November 22, 2010 Share Posted November 22, 2010 how to pass variables from the ajax function to php file? i have written my ajax in an external js file...called it from one php file say a.php and then the ajax calls the file b.php....but it is not executing.... if i place contents of b.php in a.php it works fine but what happens is the header also get printed because i have placed my ajax script in the header file before </head>...please help Quote Link to comment Share on other sites More sharing options...
devilinc Posted November 22, 2010 Author Share Posted November 22, 2010 to make it more clear three files, a.php where the display of results and b.php where i wrote the db query for ajax and external_js_file.js where i have my ajax code....they dont seem to co-relate now or no action takes place when i click my drop down and select a value..... if i place my b.php contents in a.php itself and remove my external js file and place its contents in my header file, everything works BUT BUT BUT, the output page i.e. a.php prints out the header too in the <div> where it should display the results only Quote Link to comment Share on other sites More sharing options...
devilinc Posted November 22, 2010 Author Share Posted November 22, 2010 ok i worked on it and it seems i dont know how to pass the value of the selected drop down item to my javascript function....how do i pass it? 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.