I want to get a PHP variable from Javascript. so I use help from HTML
<input type="text" value="" name="number1"id="number"style="display:none;">
And then I give the value from Javascript
var c = (Math.floor((Math.random() * 8) + 5)).toString(); document.getElementById("number").value = c;
And finally, take it in PHP
$number =$_POST["number1"];
Is it dangerous and has any errors? thank you
source share