Zitat:
<?php
session_start();
require_once("config.php");
?>
<?php
$name = $_POST['name'];
$pword = md5($_POST['pword']);
if($name&&$pword)
{
$chkuser = mysql_query("SELECT username FROM login WHERE username = '{$name}'");
$chkuserare = mysql_num_rows($chkuser);
if($chkuserare != 0)
{
$chkpword = mysql_query("SELECT password FROM login WHERE username = '{$name}'");
$passworddb = mysql_fetch_assoc($chkpword);
if(md5($pword) != $passworddb ['password'])
{ header ("Location: home.php");
$_SESSION['username'] = $name;
}
else
{
echo "Das Passwort ist falsch";
}
}
else
{
echo "User nicht vorhanden!";
}
}
else
{
?>
<html>
<head>
<title>
Networld - Home
</title>
<style>
#content {
width: 850px;
backround-color: orange;
margin:auto
}
a:link {
text-decoration:none;
font-weight:bold;
font-size:14px;
color: red;
}
#main {
width: 900px;
height: 1600px;
background-color: orange;
margin: auto;
}
#menu {
width: 800px;
height: 50px;
background-color: red;
align: center;
margin: auto;
margin-top: 20px;
}
#header {
width: 500px;
height: 150px;
background-color: blue;
align:center;
margin: auto;
}
.button3 {
height: 40px;
width: 160px;
font-family: Arial, Helvetica, sans-serif;
font-size: 18px;
font-weight: bold;
}
</style>
</head>
<body link="ff0000">
<div id="main">
<br>
<div id="header">
<center>
<font size="7" color="white">
Networld
</font><br>
<font size="5" color="white">
Der Internetblog!
</font>
</center>
</div>
<div id="menu">
<center>
<input type="submit" name="Home-Button" value="Home" class="button3" onClick="self.location.href='index.php'">
</center>
</div>
<div id="content">
<b><center><h1>Log-in</h1></center></b><br>
<form method="post" action="index.php">
<table width="600">
<tr><td>Nutzername:</td><td><input type="text" name="name" /></td><td>Passwort:</td><td>
<input type="password" name="pword" /></td><td><input type="submit" name="register" value="Login" />
</td></tr><tr>
<td><font color="white"><a href="register.php">Registrieren</a></font></td><td><?php
echo "Bitte füllen sie alle Felder aus!";
}
?>
</td></tr>
</table>
</form>
<br>
<h4>Bitte loggen sie sich ein, um alle Funktionen der Website grenzenlos nutzen zu können.<br><br>
Sie sind noch nicht registriert? Dann tun sie das! Einfach unter dem Login-Formular auf den
Link Registrieren klicken!</h4>
</div>
</div>
</body>
</html>
Lach nie über jemanden, der einen Schritt zurück geht!! Er könnte Anlauf nehmen! -.-