Here's javascript code that i have
var randomnum = 30;
and here's PHP code
<?php $_SESSION['numbertoguess'] = '<script>document.write(randomnum)</script>';?>
But this is not passing the value But when i am trying this code below, it works. It gives session variable that the value 'a sample thing'.
<?php $_SESSION['numbertoguess'] = 'a sample thing';?>