Omaruchan Omaruchan - 2 years ago 100
PHP Question

Ajax POST sending back empty response

I'm having a problem with Ajax and POST, as it is not working, sending an empty response, I'm working with text (not Json) data.

Here's the javascript code:

type: "POST",
url: "php/bddAlumnoElements.php",
data: "methodo=setLecturas,idLectura="+CurrentLecture,
async: true,
success: function(response) {
cache: false,
contentType: false,
processData: false
return false;

And here's the simple php code I'm using

echo "blah!";

I've also tried the php code like this

$message= "blah!";

The response alert is always blank, so I have no idea what's going on, any suggestions?

Answer Source

Change here , to &

   data: "methodo=setLecturas&idLectura="+CurrentLecture,

Parameter separates by symbol & not by commas , so methodo value becomes unwanted concatination with comma.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download