aksd Posted April 27, 2007 Share Posted April 27, 2007 hi all i've put neave snake on my site, and i want to be able to keep the highscores i've decompiled the flash game and i found this script (i'll upload it somwhere else if needed) and i found out that the game sends the scores to games_score.php wich sends them to a txt file. this is the data that is sent to games_score.php : game=snake3&url=http%3A%2F%2Fwww%2Eneave%2Ecom%2Fgames%2Fsnake%2Fsnake%2Eswf&name=somename&score=195 what do i have to write in games_score.php to work ? please, help me thnks! Quote Link to comment Share on other sites More sharing options...
nikkieijpen Posted April 27, 2007 Share Posted April 27, 2007 This code only works if you only store the highest score, not if you want a list if i.e. the ten highest scores. However, this script might help you further... if(isset($_GET) { $score= $_GET['score']; $username = $_GET['name']; $file = "http://localhost/test/highscore.txt"; //contains i.e. "Username,Highscore"; $fh = fopen($file, "r"); $content = fread($file); fclose($fh); $content = explode(",",$content); $highScore = $content[1]; if($score > $highScore) { $fh = fopen($file, "w"); $newContent = $username.",".$score; fwrite($fh, $newContent); fclose($fh); } Quote Link to comment Share on other sites More sharing options...
aksd Posted April 27, 2007 Author Share Posted April 27, 2007 thanks A LOT for trying to help me! you're the first i wrote that in games_score.php, but it doesn't work it doesnt't write anything to highscore.txt Quote Link to comment Share on other sites More sharing options...
aksd Posted April 29, 2007 Author Share Posted April 29, 2007 i have progressed a little i found this script http://rapidshare.com/files/28477013/highscoresss.zip , and modified it a little, and now the scores are writing in the database, but i don't know how to display them in the game. i know i have to write in games_score.php some code from loadscores.php (from the archive) but i don't know exactly what thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.