<?php
if (!
isset($_POST['username']) || !
isset($_POST['password'])) {
echo '<META HTTP-EQUIV="Refresh" Content="0; URL=index.php">';
}
elseif (empty($_POST['username']) ||
empty($_POST['password'])) {
echo '<META HTTP-EQUIV="Refresh" Content="0; URL=index.php">';
}
else
{
$dbHost = "localhost";
$dbUser = "";
$dbPass = "";
$dbDatabase = "";
$db =
mysql_connect("$dbHost",
"$dbUser",
"$dbPass") or
die ("Kunde inte ansluta till Databasen");
$pass =
md5($_POST['password']);
$result=
mysql_query("select * from members where username='$user' AND password='$pass'",
$db);
if($rowCheck > 0)
{
{
$_SESSION['username'] = $user;
$_SESSION['lastpage'] = 'login.php';
echo '<META HTTP-EQUIV="Refresh" Content="1; URL=edit.php">';
}
}
else
{
echo 'Inkorrekt Användarnamn eller Lösenord. Prova igen!';
}
}
?>