Hi all,
I’m having a problem using jQuery $.post with a php file. I have the following code:
[code=javascript]
$.post( “http://www.mywebsite.com/myfile.php”, {v1: v1_value, v2 : “string”, v3: v3_value});
I've checked in firebug that the "data values" are as expected going into the .post function. So I thought the problem might lie with the php code, which is as follows:
[code=php]
<?php
// Sanity check
$cmd = "touch ajax_call.txt";
exec("$cmd 2>&1", $array);
$v1 = $_POST['img'];
$v2 = $_POST['prog'];
$v3 = $_POST['value'];
// other code
?>
The sanity check of file touching is happening. When I check the apache error_logs file, it says PHP Notice: Undefined index: v1 and there are similar errors for v2 and v3.
I don’t understand what I’m doing wrong? or is anything else I can try to debug this further?
Many thanks!