i see one example in which they pass javascript variable into php by like this:
<html>
<head>
<script type="text/javascript">
var q = "hello";
<?php
$ff ="<script>document.write(q1)</script>";
?>
</script>
</head>
<body>
<?php echo $ff; ?>
<input type="hidden" value="nis" id="val">
</body>
</html>
i try one exaple like this:
<html>
<head>
<script type="text/javascript">
var q = $("#val").val();
<?php
$ff ="<script>document.write(q)</script>";
?>
</script>
</head>
<body>
<?php echo $ff; ?>
<input type="hidden" value="nis" id="val">
</body>
</html>
but its not give output. there is any solution for this problem? how can i get value in php variable? i want "nis" in $ff variable.