I want to post a variable to PHP page using jQuery and then redirect on that PHP page and echo posted variable.
HTML:
$(document).ready(function() {
$('.restauarnt_result').click(function() {
var RestName = $('#restauarnt_name', this).html();
$.post('restauarnt.php', { RestName : RestName } );
window.location = 'restauarnt.php';
});
});
After I click on $('.restauarnt_result'), automatically redirect to 'restauarnt.php' URL and echo the posted data.
PHP:
<?php
echo $_POST['RestName'];