Jump to content

High score system


rogonow

Recommended Posts

I try to get a high score system to work. The problem is to write data to the txt file:

The file adder.php contains:

<?php
if(array_key_exists('name',$_GET)==true and array_key_exists('score',$_GET)==true)
{
$name=$_GET['name'];
$score=$_GET['score'];
$file=fopen('highscore.txt','a');
fwrite($file,$name.';'.$score.';'); 	
fclose($file);
}

header("Location: index.php"); // Replace index.php with the name (and, if not in the same folder, path)
                               // of the page that will display the scores (see below)

?>

 

I use this website: http://members.multimania.nl, so it looks like http://members.multimania.nl/mine/adder.php?name=winner&score=99

 

What am I doing wrong?

 

 

Link to comment
https://forums.phpfreaks.com/topic/223634-high-score-system/
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.