My login was working a few days ago, i did not change anything, but changed stuff around it including the sessions etc, i have stripped it completely down to just the login and it still doesn't work so i am at a loss! can anyone see what the problem is?
<?php
session_start();
$Login=$_POST['Login'];
if($Login){ // If clicked on Login button.
$username=$_POST['username'];
$password = $_POST['password'];
$md5_password=md5($password); // Encrypt password with md5() function.
include("DBdetail.php");//connect script
$link = mysql_connect($host,$user,$password);
mysql_select_db($db);
if (!$link)
{
die('Could not connect to the database: ' . mysql_error());
}
$result=mysql_query("select * from r_customer where username='$username' and password='$md5_password'");
if(mysql_num_rows($result)!='0'){ // If match.
session_register("username"); // Create session username.
echo "---Welcome $username---"."<br>";?>
<a href=confirm.php>Click to continue</a>
<?
exit;
}else{ // If not match.
$message="--- Incorrect Username or Password ---";
}
}
?>
<html>
<head>
<title>Booking</title>
</head>
<body>
<? echo $message; ?>
<form id="form3" name="form3" method="post" action="login1.php">
<fieldset><legend><span><h3>Login</h3></span></legend>
<label for="username">User Name:</label> <input type="text" name="username" /><p>
<label for="password">Password:</label> <input type="password" name="password" /><p>
<input name="Login" type="submit" name="Login" value="Login" />
</form>
</fieldset>
</body>
</html>