<?php ob_start(); ?>
<?php include("config.inc.php"); ?>
<html>
<head>
<title>stokesdesign.de - tetris revival</title>
<style type="text/css">
<!--
td { font-family: "Trebuchet MS", Geneva, Arial, Helvetica, sans-serif; font-size: 11px; color: #000000}
body {
background-attachment: fixed;
background-image: url(../img/splash/1.gif);
background-repeat: no-repeat;
background-position: left top;
font-family: "Trebuchet MS", Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
}
A:link { font-family: "Trebuchet MS", Geneva, Arial, Helvetica, sans-serif; font-size: 11px; color: #000000; text-decoration: none}
A:hover {
font-family: "Trebuchet MS", Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #000000;
text-decoration: none;
font-weight: bold;
}
A:visited { font-family: "Trebuchet MS", Geneva, Arial, Helvetica, sans-serif; font-size: 11px; color: #000000; text-decoration: none}
.Stil1 {color: #000000}
-->
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0">
<div align="center">
<table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="10" bgcolor="#FFFFFF" class="Stil1"> </td>
<td width="390" bgcolor="#FFFFFF" class="Stil1"><b>eintrag in die datenbank - highscore</b></td>
</tr>
</table>
<br>
<form name="senden" method="post" action="dbentry.php">
<table width="40%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td width="2%"> </td>
<td width="27%">Name : </td>
<td width="71%">
<input type="text" name="player" maxlength="100">
</td>
</tr>
<tr>
<td width="2%"> </td>
<td width="27%">Punktzahl :</td>
<td width="71%">
<?php
$verbindung = @mysql_connect("$dbhost","$dbuser","$dbpass");
if (!$verbindung) {
echo "Keine Verbindung möglich!\n";
exit;
}
$abfrage = "SELECT * FROM $sqltable2 ORDER BY id DESC";
$ergebnis = mysql_db_query($dbtable,$abfrage,$verbindung);
while (list($id,$punktzahl) = mysql_fetch_row($ergebnis))
{
if($punktzahl == 0 OR $punktzahl == ""){ Header("Location: loser.php");
exit(); } else {
echo "$punktzahl";
}}
?>
</td>
</tr>
<tr>
<td width="2%"> </td>
<td width="27%"> </td>
<td width="71%"> </td>
</tr>
<tr>
<td width="2%"> </td>
<td width="27%"> </td>
<td width="71%">
<input type="submit" name="senden" value="ok!">
</td>
</tr>
</table>
</form>
</div>
<?php
if($senden){
if ($player == "") {
echo "<center>Du hast keinen Namen angegeben!</center>";
exit(); }
else
{
$verbindung = @mysql_connect("$dbhost","$dbuser","$dbpass");
if (!$verbindung) {
echo "Keine Verbindung möglich!\n";
exit;
}
$abfrage = "SELECT * FROM $sqltable2 ORDER BY id DESC";
$ergebnis = mysql_db_query($dbtable,$abfrage,$verbindung);
while (list($id,$punktzahl) = mysql_fetch_row($ergebnis))
{
$verbindung = @mysql_connect("$dbhost","$dbuser","$dbpass");
if (!$verbindung) {
echo "Verbindung zur Datenbank ist nicht möglich!\n";
exit;
}
mysql_select_db($dbtable,$verbindung);
$daten = "INSERT INTO $sqltable (name,highscore) VALUES ('$player','$punktzahl')";
$result = mysql_query($daten,$verbindung);
Header("Location: highscore.php");
exit();
}}
} ?>
<?php mysql_close($verbindung); ?>
</body>
</html>
<?php ob_end_flush(); ?>