PHP output fails from AJAX call
| From: | Adarsh Sharma | Date: | Thu, 30 Jan 2014 06:27:44 +0000 |
| Subject: | PHP output fails from AJAX call | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-322762@lists.php.net to get a copy of this message | ||
Hi,
I am using AJAX and php for creating a small UI that retrieves data from
mysql upon clicking on one button. But i clicked on that , nothing is
happening. Below is my index.html :
*-- index.html *
<html>
<head>
function week_report_fun(){
var ajaxRequest;
---
---
--
ajaxRequest.open("GET","ajaxex.php?q="+users,true);
ajaxRequest.send();
}
</script></head><body>
<form>
User : <select id="users" onchange="week_report_fun()">
<option value="">Select a user</option>
<option value="133">av</option>
<option value="168">ad</option>
<option value="78">so</option>
<option value="239">ak</option>
</select></form><br>
<div id="txtHint"><b>Person info will be listed here.</b></div>
</body></html>
*Access Log Output :-*
1.4.15.25 - - [30/Jan/2014:06:05:52 +0000] "GET /project/ajaxex.php?q=133
HTTP/1.1" 200 5323 "http://db11.app.com/project/" "Mozilla/5.0
(Macintosh;
Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/32.0.1700.102 Safari/537.36"
1.4.15.25 - - [30/Jan/2014:06:06:13 +0000] "GET /project/ajaxex.php?q=133
HTTP/1.1" 200 5323 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.102 Safari/537.36"
No errors in error.log.
Strange thing if i directly open below link in the browser, report is
coming and i am able to see in the browser :
*http:///db11.app.com/project/ajaxex.php?q=133
<http://db11.app.com/project/ajaxex.php?q=133>*
It means my ajaxex.php is fine and no issues but dont understand why it is
not working as expected after clicking on button.Please let me know if i am
missing something.
Thanks