Re: PHP output fails from AJAX call
| From: | Tim Streater | Date: | Thu, 30 Jan 2014 09:42:00 +0000 |
| Subject: | Re: PHP output fails from AJAX call | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-322766@lists.php.net to get a copy of this message | ||
On 30 Jan 2014 at 06:27, Adarsh Sharma <eddy.adarsh@gmail.com> wrote:
> 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>
Missing <script ... > as Niklaus has pointed out.
> function week_report_fun(){
> var ajaxRequest;
> ---
> ---
> --
> ajaxRequest.open("GET","ajaxex.php?q="+users,true);
What is "users"? Where is your code to get the selected value from the form?
> 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>
Where is your code to get the returned results from your PHP script and display it?
--
Cheers -- Tim