Jump to content

pass variables to php file


devilinc

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/219447-pass-variables-to-php-file/
Share on other sites

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.