Im using ajax to pass params through a post. Pretty much my issue is that when i recieve the params in PHP if i do a isset($_POST['param']) it returns true and if i echo the param it displays undefined. The param im passing through ajax is not set which is correct in this case. The idea would be when i check if the param is set for it to return false if it is undefined, however this isnt happening. Any specific reasons as to why this might be?
$param= $_POST['param'];
$concat = array();
if(!empty($param) && isset($param)){ $concat[] = "param= '" . mysql_real_escape_string($param) . "'"; }
The above is my actual code ive done echos on the original $_POST['param']; and also on $param to see if this was the problem but it results the same. the echos ive done are of the actual param/variable and of the result of isset on these two.
Thanks in advance!
UPDATE
ajax
$.ajax({
type: "POST",
url: "ajax/update.php",
dataType: "text",
data: "param=" + param,
async: false,
success: function(response) {
if(response)
{
alert(response);
}
}
});
param is defined above but in this specific case is not being set to anything it remains empty, passing an empty var.