//Login Query
if (($_POST['myusername'] == "") || ($_POST['mypassword'] == "")) {
$err="Complete both boxes to continue";
} else {
$sql = "SELECT * FROM `sign_up` where email ='".$_POST['myusername']."'";
$result = mysql_query($sql);
// Login check and error reporting
if ($result==FALSE) {
$err="Username invalid please check you typed it in correctly and try again";
} else {
$userdetails = mysql_fetch_row($result);
if(md5($_POST['mypassword'])==$userdetails[17])
{
session_cache_expire(40);
session_start();
if (!isset($_SESSION['userid'])) {
$_SESSION['userid'] = $_POST['myusername'];
}
header( 'Location: home2.php' ) ;
} else {
$err="Password invalid please check you put it in correctly and try again";
}
}
}
?>
Hi, this is the main bit of code the header shows the divert.