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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.