exchange data from javascript to php
| From: | Corneel@dexternet.nl | Date: | Thu, 24 Oct 2002 10:29:11 +0000 |
| Subject: | exchange data from javascript to php | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-121224@lists.php.net to get a copy of this message | ||
Hi
I found a cool javascript game.
At the end, the game score wil be set to 0.
Before that happens I want it to be possible the user can leave his name and together with the game
score,this will be stored in a mysql db with php.
I really don't know how to exchange the dat from javascript to php.
function Restart_Game() {
<?php
$db = mysql_connect("localhost","dbname","passwd");
mysql_select_db("dbname",$db);
$query = "INSERT INTO dextris (naam, plaats, score, datum, IP) VALUES ('sjaak',
'game_score', '2333', '3-4-2002', '$ipadres')";
$result = mysql_query($query);
?>
high_score = (high_score < game_score)?game_score:high_score;
game_score = 0;
The word game_score is now stored in the db, so the connection works, but now the right game
score....
Thanks in advance
Corneel van Schie
The Netherlands
www.dexternet.nl