views:

88

answers:

3

I recently asked this question:

http://stackoverflow.com/questions/694849/dynamically-query-a-database-to-check-for-value/694860#694860

And I got an awesome and informative answer. But whenever I search on Google to find out more about "Ajax Requests" the codes never look similar to the one provided. Also I have used another tutorial that used this, is it a shorthand? Or is it jQuery or what?

That horrible confusion, is messing up my ability so solve the following problem:

Sending the value of the field to the PHP script. I tried using something along the lines of::

$value = $GET["inputname"];

but that does not seem to work. Could you please help? I am very adept in PHP but I am very new to javascript. THANKS!

+2  A: 
$.get(url,{},verifyDb);

is the jQuery ajax Get method. You can pass a parameter like this:

$.get(url,{inputname: "value goes here"},verifyDb);

$ is a shorthand for the jQuery object. I would familiarize yourself with the jQuery docs.

John Sheehan
Thanks for your help :)
Chris B.
+1  A: 

Maybe I'm an idiot but

$value = $GET["inputname"];

Should be:

$value = $_GET["inputname"];

Also,

But whenever I search on Google to find out more about "Ajax Requests" the codes never look similar to the one provided.

You need to be googling on 'jquery ajax requests'

karim79
That was a typo in the question. Thanks for your help :)
Chris B.
A: 

The problem could be that by default Ajax requests are usually POST requests, not GET. So, in your PHP script, looking for $_GET['blah'] ain't gonna work. Try $_POST['blah'] and let us know if you find the vars you're looking for.

Andrew Hedges