Location: PHPKode > projects > OneForum > oneforum/moderator/signin.php
<?php

	///////////////////////////////////////////////
	// OneForum                                  //
	// www.onescripts.de - Free PHP Scripts      //
	// (C) 2012 by OneScripts.de - Team          //
	// hide@address.com                   //
	///////////////////////////////////////////////

	include_once('../data/config.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 = '2'") or die(mysql_error());

	$total = mysql_num_rows($query);

	if ($total > 0) {
	
		session_start();
		$_SESSION['user_name'] = 'user_name';
		header("Location: index.php");
	
	}else{
	
		$error = '<p align="center" class="false">( login incorrect )</p>';
		}
	}

?>
<!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=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="../layout/design.css" />
<link rel="shortcut icon" href="../layout/favicon.ico" type="image/x-icon" />
<title>OneForum - Moderators Area</title>
</head>

<body>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p align="center"><a href="signin.php"><img src="files/logo.png" width="192" height="48" border="0" /></a></p>
<p align="center">&nbsp;</p>
<p align="center"><strong>Please sign in to make settings</strong><br />
  <em>(For security reasons, your IP logged:
  <?php
  echo "",
  $_SERVER['REMOTE_ADDR'];
?>
)</em></p>
<p>&nbsp;</p>
<p><form action="signin.php?verify" method="post" name="mod-login">
  <table width="300" align="center" class="boxtable">
    <tr>
      <td><table width="300" border="0" align="center" cellpadding="0" cellspacing="3">
        <tr>
          <td height="20" colspan="2">&nbsp;&nbsp;<u><strong>Moderators sign in</strong></u></td>
        </tr>
        <tr>
          <td width="80">&nbsp;&nbsp;<strong>User Name</strong></td>
          <td width="220"><label>
            <input name="user_name" type="text" class="fields" id="user_name" size="25" maxlength="25" />
          </label></td>
        </tr>
        <tr>
          <td width="80">&nbsp;&nbsp;<strong>Password</strong></td>
          <td width="220"><label>
            <input name="user_pass" type="password" class="fields" id="user_pass" size="25" maxlength="25" />
          </label></td>
        </tr>
        <tr>
          <td width="80">&nbsp;</td>
          <td width="220"><label>
            <input type="submit" class="button" name="verify" value="verify" />
          </label></td>
        </tr>
      </table></td>
    </tr>
  </table>
</form>
<?php echo $error; ?>
</body>
</html>
Return current item: OneForum