How can I store JavaScript variable output into a PHP variable?

 <?php


$browsers ="<script>document.write(userbrowser)</script>";


echo $browsers;


?>

Where userbrowser is a javascript variable



<script> 
var myJavascriptVar = '123456';
document.cookie = "myJavascriptVar = " + myJavascriptVar </script>

<?php
echo $myPhpVar= $_COOKIE['myJavascriptVar'];
?>

Post a Comment

0 Comments