I have no idea why I am getting this weird error!
PHP Notice: Undefined index: refId in /var/www/echo.php on line 5
I am getting Console output, but cant echo refId
. Have I done anything wrong here?
<?php
$rollUrl = 34;
$refId = $_POST['refId'];
echo $refId;
?>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
$.ajax({
url:'echo.php',
type: 'POST',
data: { 'refId': "<?php echo $rollUrl ?>" },
success: function(response){
console.log('Getting response');
}
});
</script>