I have a variable in JavaScript that I can send to value
of a form
in html.
The input where the variable is loaded is like hidden
because I do not want it to display the value on the screen. The form only has that input
and a button to send the form by method POST
to a PHP file where I want it to store the variable.
The point is that he does not ...
I do not know what I'm missing or what I'm doing wrong. I put the code here.
JavaScript file
document.getElementById("puntos").setAttribute("value",highscore);
I use this to send the value
of the form input and it works.
HTML file
<form action="rank_insert.php" method="post">
<input id="puntos" name="puntos" type="hidden" value="" />
<input type="submit" name="submit" value="Guardar" />
</form>
PHP file
<?
$puntos = $POST['puntos'];
echo "Puntos: ".$puntos;
?>
And here is where only the text "Points:" appears and nothing more ... It's as if the variable was not passed.