File: /home/posscale/subdomains/ccm/files/login.php
<?
if(isset($_POST['username']) && !empty($_POST['username']))
{
$login = db_query("SELECT *
FROM `user`
WHERE `username` ='".db($_POST['username'])."'
AND `password` ='".db($_POST['password'])."'");
if($login['mysql_num_rows']>0 && $login['active'][0]==1)
{
$_SESSION['user'] = $login;
redir("./");
}
elseif($login['mysql_num_rows']>0 && $login['active'][0]==0)
{
echo "There is a problem with you account, please contact us for further assistance.";
}
else
{
echo "Your username or password was not recognised, please check for errors.";
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Login</title>
<style type="text/css">
@import url('includes/css/global.css');
</style>
</head>
<body>
<div id="login">
<form method="post" action="" enctype="multipart/form-data">
Username: <input type="text" name="username" /><br />
Password: <input type="password" name="password" /><br /><br />
<input type="submit" value="login" />
</form>
</div>
</body>
</html>