jquery到html(通过文本)到服务器(通过$ _POST)

In JS/Jquery i have a button, and every time button is clicked a var is incremented. Then i send that variable to html, like this:

//....
var x++;
//....
$('#Score').text(x);

No problem here. Then, in html i have a form like this (that activates when i press "finish" image):

<form name="form_1" method="post" action="form_1_submit.php">
<input name="Score" id="Score" style="display:none;"></div>
<input src="../finish.png" id="finish_btn" type="image">
</form>

I also have a submit file:

//...
$r1 = $_POST['Score'];
//...
$insert = $dbh->prepare("INSERT INTO challenge_log (userID, challengeID, tries, question, answer) VALUES ('$id','$ch','$try','$question','$r1')");
$insert->execute();

The problem is that i cant get $r1. When i check the database i have all values but r1... Am i doing something wrong?

Make the "score" input type="hidden", instead of doing a display:none. Also, I hope you're sanitizing your inputs prior to database insertion!