The code below does not return any errors and I can make it return data from process.php however on process.php I am checking for "message" like this:
<?PHP
if (isset($_REQUEST['message'])) {
//return a json string
}
?>
Here is my jquery code below, dataString shows "message=WHATEVER I TYPE IN THE TEXTAREA" when I use alert (dataString); but it act like it is not being sent to the processing.php script, I am at a dead end right now
If i go to www.url.com/processing.php?message=whatever then the php script shows what you would expect.
Also it seem the ajax part is working because it will return a response to the script if I have the php script output something without wrapping it in my if statement
What could the problem be?
<script>
var dataString = 'comment='+ message;
//alert (dataString);
// send message to PHP for processing!
$.ajax({
type: "POST",
url: "process.php",
data: dataString,
dataType: "json",
success: function (data) {
// do stuff here
}
});
</script>