I have a php script that is being called by an ajax post. I am getting the error
Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\Escape\SendTestimony.php on line 9
Here is the paramaters
$name = $_POST['name'];
$message = $_POST[‘message’];
Here is line 9 where the error occurs. Thanks for any help.
mysql_query("CALL sp_CreateTestimony("$name.", "$message.")");
EDIT ADDED JQUERY AJAX CALL
var parameters = {
'name': $('#cf_name').val(),
'message': $('#cf_message').val()
}; //Use JSON to pass parameters into ajax calls
parameters = JSON.stringify(parameters);
//Make ajax call to post to database
$.ajax({
type: 'POST',
url: '../Escape/SendTestimony.php',
datatype: 'json',
data: parameters,
success: function (result) {
alert(result);
$('#ValidateTest').html('Thank-you!').css({ 'color': 'green' }).show();
},
error: function(jqXHR, textStatus, errorThrown) {alert(textStatus + ":" + errorThrown);}
});
you should add dots before variables and single quotes around them: