hello,i have no idea where i will put the passwod_verify function and what i must code the verify exactly in order to get the plain txt password be compared with the hashed version ?
my code is below and part of my database also.
<?php require_once('Connections/bankusers.php'); ?>
<?php session_start(); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
}
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}
if (isset($_POST['UserName'])) {
$loginUsername=$_POST['UserName'];
$password=$_POST['Password:'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "loginusermemo.php";
$MM_redirectLoginFailed = "loginuser.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_bankusers, $bankusers);
$LoginRS__query=sprintf("SELECT UserID, Password FROM users WHERE UserID=%s AND Password=%s",
GetSQLValueString($loginUsername, "int"), GetSQLValueString($password, "text"));
$LoginRS = mysql_query($LoginRS__query, $bankusers) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";
if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Login User</title>
<meta name="description" content="website description" />
<meta name="keywords" content="website keywords, website keywords" />
<meta http-equiv="content-type" content="text/html; charset=windows-1252" />
<link rel="stylesheet" type="text/css" href="style/style.css" title="style" />
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="main">
<div id="header">
<div id="logo">
<div id="logo_text">
<!-- class="logo_colour", allows you to change the colour of the text -->
<h1><a href="index.php">ModelOnline<span class="logo_colour">Bank</span></a></h1>
<h2>Your. Bank. On. Demand.</h2>
</div>
</div>
<div id="menubar">
<ul id="menu">
<!-- put class="selected" in the li tag for the selected page - to highlight which page you're on -->
<li class="selected"><a href="index.php">Home</a></li>
<li><a href="register.php">REGISTER</a></li>
<li><a href="login.php">lOGIN</a></li>
<li><a href="aboutus.php">ABOUT US</a></li>
<li><a href="contactus.php">Contact Us</a></li>
<li><a href="accessibility.php">Accessibility</a></li>
<li><a href="security.php">Security</a></li>
</ul>
</div>
</div> <div align="center" class="bankservices"><a href="http://www.modelonlinebank.com/bankproducts.php#one">Current Accounts</a> | <a href="http://www.modelonlinebank.com/bankproducts.php#two">Savings Accounts</a> | <a href="http://www.modelonlinebank.com/bankproducts.php#three">Mortgages</a> | <a href="http://www.modelonlinebank.com/bankproducts.php#four">Insurance</a> | <a href="http://www.modelonlinebank.com/bankproducts.php#five">Credit Cards</a> | <a href="http://www.modelonlinebank.com/bankproducts.php#six">Investments</a></div>
<div id="site_content">
<div class="sidebar">
<!-- insert your sidebar items here -->
<h3>Latest News</h3>
<h4>Personal Banking</h4>
<h5>January 1st, 2014</h5>
<p>Current Accounts,Saving Accounts,Range of Credit And Debit cards to suit all your needs. We have your interest in mind.<br />
<a href="#">Read more</a></p>
<p></p>
<h4>Corporate Banking</h4>
<h5>February 5th, 2014</h5>
<p>We help you achieve your goals by providing numerous funding options.Provide Risk management of your finances and look for strategic and finance options to promote business.<br /><a href="#">Read more</a></p>
<h3>Useful Links</h3>
<ul>
<li><a href="#">Credit card</a></li>
<li><a href="#">Debit card</a></li>
<li><a href="#">Loans</a></li>
<li><a href="#">Insurance</a></li>
</ul>
<h3>Search</h3>
<form method="post" action="#" id="search_form">
<p>
<input class="search" type="text" name="search_field" value="Enter keywords....." />
<input name="search" type="image" style="border: 0; margin: 0 0 -9px 5px;" src="style/search.png" alt="Search" title="Search" />
</p>
</form>
</div>
<div id="content">
<!-- insert the page content here -->
<h1>Login Part 1 of 2</h1>
<p>Please kindly Input your Account Number and Password below:</p>
<form action="<?php echo $loginFormAction; ?>" method="POST" name="loginform" id="loginform">
<table width="500" border="0">
<tr>
<td><span id="sprytextfield1">
<label for="UserName"></label>
Account Number: <br>
<input type="text" name="UserName" id="UserName">
<span class="textfieldRequiredMsg">Enter Your Account Number.</span></span></td>
</tr>
<tr>
<td><span id="sprytextfield2">
<label for="Password:"></label>
Password: <br>
<input type="password" name="Password:" id="Password:">
<span class="textfieldRequiredMsg">Enter Your Password.</span></span></td>
</tr>
<tr>
<td><input type="submit" name="LoginButton" id="LoginButton" value="Login"></td>
</tr>
</table>
</form>
<p> </p>
<p> </p>
<p> </p>
</div>
</div>
<div id="content_footer"></div>
<div id="footer">
©Modelonlinebank 2014 | <a href="#sitemap">SiteMaP</a> | <a href="#privacy">Privacy</a> | <a href="#jobs">Jobs</a> | <a href="#terms">Terms</a> | <a href="contactus.php">Feedback</a></div>
</div>
<script type="text/javascript">
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
</script>
</body>
</html>