Simple question about $.post and a PHP sum
Question
I have a jQuery $.post function sending data to a PHP file which updates a DB field, grabs 1 of the values being sent to the file, adds '1' and returns the new value.
My PHP file looks as follows:
$varID = $_GET['varID'];
$varKey = $_GET['varKey'];
$varCurrentValue = ($_GET['varCurrentValue'] + 1);
update_comment_meta($varID, $varKey, $varCurrentValue);
echo $varCurrentValue;
My firebug response, if I'm understanding it correctly, confirms that the value's are being sent correctly to the PHP file: http://cl.ly/2P1Y0E3710442V3I143K [img]
However the only response that I'm getting is the "1" that I'm adding in the 3rd line of code, not the value of the sum that I should be getting.
I'm sure it's something really simple, but I'm just not seeing it...
Thanks for your help!
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow