I am trying to Post and set some value on a PHP file called session.php
using jQuery Ajax Post like
$("#up-data").on("click", function(){
var data= {
url : 'www.google.com',
product : 'Map'
};
var request = $.ajax({
type: "POST",
url: ajax_set.ajaxurl,
data: data,
cache: false,
crossDomain: true,
beforeSend: function() {
}
});
request.done(function( data) {
console.log(data);
});
request.fail(function( jqXHR, textStatus ) {
console.log( "Request failed: " + textStatus );
});
});
looks like the POST is working fine here because I am not getting any error plus I am getting the Map www.google.com
in the Response of fire bug and also in console for .done()
without any error message
but in the session PHP
$u = $_POST["url"];
$p = $_POST["product"];
echo $u . " " .$p ;
is returning nothing without any error message
Can you please let me know what I am missing or doing wrong and how I can fix this?