pass php variable from javascript to next page code example
Example: how to use javascript variable in php
<script>
var p1 = "success";
</script>
<?php
echo "<script>document.writeln(p1);</script>";
?>
<script>
var p1 = "success";
</script>
<?php
echo "<script>document.writeln(p1);</script>";
?>