I need to set up an “Activate password page” on this page i need to be able to have it access my database and recognize the proper recor based on the e-mail address and the ID Number here is my code, any sugestions.
<?PHP
$Email = $_POST['Email'];
$Pass = $_POST['Pass'];
$PassTwo = $_POST['PassTwo'];
if ($Pass == $PassTwo) {
$Pass = $Pass;
} else {
print "Passwords mismatched";
}
if (($REQUEST_METHOD=='POST')) {
for(reset($HTTP_POST_VARS);
$key=key($HTTP_POST_VARS);
next($HTTP_POST_VARS)) {
$this = addslashes($HTTP_POST_VARS[$key]);
$this = strtr($this, ">", " ");
$this = strtr($this, "<", " ");
$this = strtr($this, "|", " ");
$$key = $this;
}
if ($Email && $Pass ) {
$query = "insert into auth (username,userpassword) ";
$query .= "VALUES('$Email','$Pass')";
mysql_connect("mysql.host.com","username","password")
or die("Unable to connect to SQL server");
mysql_select_db("yourdatabase") or die("Unable to select database");
$result = mysql_query($query) or die("Insert Failed!");
}
}
if ( $result ){
print "You have successfully entered ".$Email." with the password of ".$Pass." to your database!!";
}
?>
<html>
<head>
<title>Password Form</title>
<style type="text/css">
<!--
.style1 {font-family: Arial, Helvetica, sans-serif}
-->
</style>
</head>
<body bgcolor="#FFFFFF">
<h1 class="style1">Create Password </h1>
<form action="http://www.expoships.com/admin/Seafair_Society_Login.php" method="POST" class="style1">
<p>SeaFair ID Number:<br>
<input name="ID" type="text" size="50" style="background-color: cyan;">
</p>
<p>E-Mail Address:<br>
<input type="text" size="50" name="Email" style="background-color: cyan;">
<br>
<br>
Password:
<br>
<input type="text" size="50" name="Pass" style="background-color: cyan;">
<br>
<br>
Verify Password:
<br>
<input type="text" size="50" name="PassTwo" style="background-color: cyan;">
<br>
<br>
<input type="submit" value="Create Password" style="background-color: cyan;">
</p>
</form>
<br><br>
<hr>
<?
$queryb="SELECT COUNT(*) FROM auth";
mysql_connect("mysql.host.com","username","password")
or die("Unable to connect to SQL server");
mysql_select_db("yourdatabase") or die("Unable to select database");
$numusers=mysql_query($queryb) or die ("Select Failed - count");
$numuser=mysql_fetch_array($numusers);
?>
<h3> </h3>
</body>
</html>