I need to assign javascript variable in to php variable in the javascript function This is my current code
<script>
$(document).ready(function() {
$('#datashow').on('click', '#proceed', function(event) {
event.preventDefault();
$('#confirmView').hide();
$('#confirmView').show('slow');
var price = (document.getElementById("amount").value);
var pass = 'Htj3Q3Yp10718900415738';
var key = '<?php echo md5(microtime() . rand()); ?>';
var pass = pass.concat(key);
if (price != '') {
$("#amountLabel").text(price);
$("#PurchaseAmt").text(price);
var pass = pass.concat(price);
var pass = pass.concat('144');
<?php $enc = '<script> pass </script>'?>
var enc = '<?php echo base64_encode(pack('H*', sha1($enc)));?>'
$("#pass").text(enc);
}
else {
$("#amountLabel").text('0');
}
});
});
My question is How to assign this var pass in to $enc?please help me