I can register a uder without problems, but I got troubles with showing his stats.
I can log in, but I think it is a session problem. There is no error or something else, it just doesnt show the stats.
Here are my codes
login
Code: Select all
<form method="POST" action="index.php?site=authenticate">
Nickname: <input type="text" name="name" size="21"><br>
Passwort: <input type="password" name="password" size="21">
<br>
<input type="submit" value="Login" name="submit">Code: Select all
<?php
include_once 'connect.php';
session_start();
if (isset($_POST['submit']))
{
$name=$_POST['name'];
$password=$_POST['password'];
$name=strip_tags($name);
$password=strip_tags($password);
$password=md5($password);
$query = "select name,password from user where name='$name' and password='$password'";
$result = mysql_query($query) or die("Could not query players");
$result2 = mysql_fetch_array($result);
if ($result2)
{
$_SESSION['name']=$name;
echo "<big>Logged in successfully<br>";
echo "<A href='index.php?site=profiltabelle'>Continue</a></big>";
}
else
{
echo "<big>Wrong username or password.<A href='login.php'>Try Again</a></big>";
}
}
?>Code: Select all
<?php
include_once 'connect.php';
session_start();
if (isset($_SESSION['name']))
{
$name=$_SESSION['name'];
}
else
{
echo "Not Logged in <br><br> <A href='login.php'>Login</a>";
exit;
}
$playerinfo="SELECT * from user where name='$name'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_fetch_array($playerinfo2);
?>
<html>
<head>
<meta http-equiv="Content-Language" content="de">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Allgemeines</title>
</head>
<body>
<table bgcolor="#878072" border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#40494E" width="100%" height="180">
<tr>
<td width="100%" colspan="2" bgcolor="#40494E" align="center" height="10">
<align="center"><b><font color="#FFFFFF">Allgemeines</font></b></td>
</tr>
<tr>
<td width="50%" align="center" height="19">Name</td>
<td width="50%" align="center" height="19"><?php echo $user['name']; ?></td>
</tr>
<tr>
<td width="50%" align="center" height="19">e-Mail</td>
<td width="50%" align="center" height="19"><?php echo $user['eMail']; ?></a></td>
</tr>
<tr>
<td width="50%" align="center" height="19">Geburtstag</td>
<td width="50%" align="center" height="19"><?php echo $user['geburtstag']; ?></td>
</tr>
<tr>
<td width="50%" align="center" height="19">Geschlecht</td>
<td width="50%" align="center" height="19"><?php echo $user['geschlecht']; ?></td>
</tr>
<tr>
<td width="50%" align="center" height="19">Dabei Seit</td>
<td width="50%" align="center" height="19"><?php echo $user['datesignup']; ?></td>
</tr>
<tr>
<td width="100%" align="center" bgcolor="#40494E" colspan="2" height="10">
<font color="#FFFFFF"><b>Virtuelles</b></font></td>
</tr>
<tr>
<td width="50%" align="center" height="19">Job</td>
<td width="50%" align="center" height="19">Turnierveranstalter,
Zuchtschauenausrichter, Zuchtarbeiter</td>
</tr>
<tr>
<td width="50%" align="center" height="19">Userlevel</td>
<td width="50%" align="center" height="19"><?php echo $user['userlevel']; echo "mit 2 Punkten"; ?></td>
</tr>
<tr>
<td width="100%" align="center" bgcolor="#40494E" colspan="2" height="10">
<font color="#FFFFFF"><b>Reiterliches</b></font></td>
</tr>
<tr>
<td width="50%" align="center" height="19"><b>Disziplin</b></td>
<td width="50%" align="center" height="19"><b>Niveau</b></td>
</tr>
<tr>
<td width="50%" align="center" height="19">Dressur</td>
<td width="50%" align="center" height="19">E</td>
</tr>
<tr>
<td width="50%" align="center" height="19">Springen</td>
<td width="50%" align="center" height="19">E</td>
</tr>
<tr>
<td width="50%" align="center" height="19">Military</td>
<td width="50%" align="center" height="19">E</td>
</tr>
<tr>
<td width="50%" align="center" height="19">Western</td>
<td width="50%" align="center" height="19">E</td>
</tr>
<tr>
<td width="50%" align="center" height="19">Rennen</td>
<td width="50%" align="center" height="19">E</td>
</tr>
<tr>
<td width="50%" align="center" height="19">Fahren</td>
<td width="50%" align="center" height="19">E</td>
</tr>
<tr>
<td width="100%" align="center" bgcolor="#40494E" colspan="2" height="10">
<font color="#FFFFFF"><b>Lizenzen und Abzeichen</b></font></td>
</tr>
</table>
<table bgcolor="#878072" border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#40494E" width="100%" height="1">
<tr>
<td width="50%" align="center" height="9">
Turnierlizenz Dressur</td>
<td width="50%" align="center" height="9">
Darf E-Turniere reiten</td>
</tr>
<tr>
<td width="49%" align="center" height="10">
Turnierlizenz Springen</td>
<td width="51%" align="center" height="10">
Darf E-Turniere reiten</td>
</tr>
<tr>
<td width="49%" align="center" height="10">
Turnierlizenz Military</td>
<td width="51%" align="center" height="10">
Darf E-Turniere reiten</td>
</tr>
<tr>
<td width="49%" align="center" height="10">
Turnierlizenz Western</td>
<td width="51%" align="center" height="10">
Darf E-Turniere reiten</td>
</tr>
<tr>
<td width="49%" align="center" height="10">
Turnierlizenz Rennen</td>
<td width="51%" align="center" height="10">
Darf E-Turniere reiten</td>
</tr>
<tr>
<td width="49%" align="center" height="10">
Turnierlizenz Fahren</td>
<td width="51%" align="center" height="10">
Darf E-Turniere reiten</td>
</tr>
<tr>
<td width="49%" align="center" height="10">
Zuchtlizenz</td>
<td width="51%" align="center" height="10">
Darf züchten</td>
</tr></table>
<table bgcolor="#878072" border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#40494E" width="100%" height="1">
<tr>
<td width="103%" align="center" bgcolor="#40494E" colspan="5" height="10">
<font color="#FFFFFF"><b>Erfolge</b></font></td>
</tr>
<tr>
<td width="20%" align="center" height="19"><b>Platzierung</b></td>
<td width="20%" align="center" height="19"><b>Disziplin</b></td>
<td width="20%" align="center" height="19"><b>Turnier</b></td>
<td width="20%" align="center" height="19"><b>Preis</b></td>
<td width="20%" align="center" height="19"><b>Pferd</b></td>
</tr>
<tr>
<td width="20%" align="center" height="1">-</td>
<td width="20%" align="center" height="1">-</td>
<td width="20%" align="center" height="1">-</td>
<td width="20%" align="center" height="1">-</td>
<td width="20%" align="center" height="1">-</td>
</tr>
</table>
</body>
</html>
Thank you!
Code: Select all