Location: PHPKode > projects > WH Community > wh_community/admin/signin.php
<?php

    session_start();

    define('CONFIG_CHECK', 1);
    define('MYSQL_CHECK', 1);
    define('VERSION', 'WH Community v5.0');
    define('FRAMEWORK', 'WH Framework v3.3');
    define('POWERED_URL', 'http://www.webmasterhelp.net');
    define('POWERED_BY', 'WebmasterHelp.net - WH Community');

    include_once('../framework/config.php');
	include_once('../framework/mysql.php');
	include_once('../framework/cache.php'); no_cache();
	include_once('files/language.php');

	if(isset($_REQUEST['verify'])) {

	$user_name = mysql_real_escape_string($_POST['user_name']);
	$user_pass = sha1(mysql_real_escape_string($_POST['user_pass']));

	$query = mysql_query("SELECT
							  user_id,
							  user_name,
							  user_pass,
							  user_level
						  FROM
							  users
						  WHERE
							  user_name = '" . $user_name . "'
						  AND	
							  user_pass = '" . $user_pass . "'
						  AND
							  user_level = '1'") or die(mysql_error());

	$total = mysql_num_rows($query);

	if($total > 0) {
	
		session_start();
		$_SESSION['admin'] = 'admin';
		header("Location: index.php");
	
		}else{
		$error = '<p align="center" class="login_text">' . $lang_admin['login_incorrect'] . '</p>';
		}
	}

?>
<!DOCTYPE html>
<html>

<head>
	<title><?php echo $lang_admin['admin_area']; ?></title>

    <meta charset="ISO-8859-1" />
    <meta name="robots" content="index,follow" />

    <link href="../css/admin.css" rel="stylesheet" />
    <link href="../images/favicon.ico" rel="shortcut icon" />

    <!--[if IE]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
</head>

<body id="login-bg">
 
<div id="login-holder">

	<div id="logo-login">
		<a href="signin.php"><img src="../images/logo.png" alt="Logo"></a>
	</div>
	
	<div class="clear"></div>
	<div id="loginbox">
	
	<div id="login-inner">
		<form action="signin.php?verify" method="post" name="admin-login">
		<table width="450" border="0" align="center" cellpadding="0" cellspacing="0">
			<tr>
			  <td height="20" colspan="2"><span class="login_htext"><?php echo $lang_admin['admin_signin']; ?></span><br><br><br></td>
			</tr>
			<tr>
			  <td width="75"><span class="login_text">User Name</span></td>
			  <td width="375"><label>
				<input name="user_name" type="text" class="fields" id="user_name" size="35" maxlength="35">
			  </label></td>
			</tr>
			<tr>
			  <td width="75"><span class="login_text"><?php echo $lang_admin['Password']; ?></span></td>
			  <td width="375"><label>
				<input name="user_pass" type="password" class="fields" id="user_pass" size="35" maxlength="35">
			  </label></td>
			</tr>
			<tr>
			  <td width="75">&nbsp;</td>
			  <td width="375"><label>
				<input type="submit" class="button" name="verify" value="<?php echo $lang_admin['signin']; ?>">
			  </label></td>
			</tr>
		  </table>
		  </form>
	   
	   <?php if($error) echo $error; ?>
	
	</div>
	<div class="clear"></div>

	</div>
</div>

</body>
</html>
<?php

    if(!$database) {

        die(mysql_error());
        mysql_close($connect);

        exit;
        }

?>
Return current item: WH Community