AJAX/JQUERY/PHP issue -


I use an AJAX 'post' call to send data to a php file via jquery $ .ajax function I am For some reason the callback is a success, but the data is not found in the php file. Here is an example of code:

  in JS file: $ .ajax ({type: "POST", url: "setData.php", data: "myPOSTvar = myData" success: function () {Warning ("Data saved");}}); In the php file: $ var = $ _POST ['myPOSTvar'] ...  

$ var ends with data rather than the default value.

Any thoughts?

Sorry about Syntax Errors ... I do not have my code right now and at work ... Syntax is all right in the actual script, just typed

Try it out and see if you get any information.

  $ Post ("setData.php", {myPOSTvar: "myData"}, function (data) {warning ("data saved");});  

Comments