Jump to content

Adding score


ryeman98

Recommended Posts

Hi. I've recently added a new game to my site and the adding score won't work... To be honest, I'm not sure how to do this so maybe you could help.

 

Pocobueno, if you help again that would be so awesome! xD

 

$score = $_POST['score'];
$name = $_POST['name'];

 if ($_SESSION['username']) {
$username = $_SESSION['username'];
$addpoints = mysql_query("UPDATE users SET points=points+$score WHERE username='$username'");
}

$insert_score = mysql_query("INSERT INTO rps (name, score) VALUES ('$name', '$score')");
echo "Your score has been submitted. Go <a href='scores.php?page=rps'>here</a> to view the high score table!";
}

 

And yes... I do have session_start(); at the top of my page ;)

Link to comment
https://forums.phpfreaks.com/topic/60483-adding-score/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.