function hashValue(ID){
jQuery.ajax({
url: "<?php echo get_template_directory_uri(); ?>/getHashvalue.php",
data: {ID:ID},
success: function(res) {
alert(res);
}
});
}
The above jQuery Ajax call is passing ID as the Parameter successfully.
But the PHP code is not able to receive the ID sent by Ajax.
<?php
if(isset($_POST['ID']))
{
$hashid = $_POST['ID'];
}
$hash = hash('sha1', $hashid);
print_r($hash);
exit;
?>
Error is as follows
( ! ) Notice: Undefined variable: hashid in G:\wamp\www\wp-content\themes\theme1\getHashvalue.php on line 6