Location: PHPKode > projects > Backend code/CMS for blizzle.com > v1.x/password.php
<?
// INCLUDES all neccessary page building functions
require "functions.php";

// THIS IS JUST A SIMPLE FORM THAT POSTS TO ITSELF TO SAVE THE DATA.
global $here;
if (retLoggedIn()) {
	if (($password2) && ($password == $password2)) {

		$query = "UPDATE users set userPassword=MD5('$password') WHERE userID = ".retUserID().";";
		$result = mysql_query ($query, $link) or die (mysql_error());

		$frmUsername = retUserName();
		$frmUserpassword = $password2;
		chkLogin();

		$retval = $retval."<table width=100% border=0><tr><form method=post action=\"$here\"><td colspan=2><strong><i>Change Password</i></strong></td></tr>";
		$retval = $retval."<tr><td colspan=2>Your password should be unique to you and not easily guessed.  Please enter it twice below for verification.</td></tr>";
		$retval = $retval."<tr><td><strong>password:</strong></td><td width=100%><input type=password name=password></td></tr>";
		$retval = $retval."<tr><td><strong>again:</strong></td><td width=100%><input type=password name=password2></td></tr>";
		$retval = $retval."<tr><td colspan=2><center><input type=submit name=\"Change Password\" value=\"Change Password\"></td></tr></form></table>";

		$retval = createItem("Change Password Successful",date("Y-m-d H:i:s"),"Yeah.  It worked.  Now git.  Or do it again.".$retval,null,"blizzle","admin","blizzle",null,null,null,null,null);

	} else {


		$retval = "So you wanna change your password?  That's too bad.  *sigh*.  Fine, change it.  See if I care.  I can't stop you.  Only you can stop yourself.  I have no spine.<p>";
		$retval = $retval."<table width=100% border=0><tr><form method=post action=\"$here\"><td colspan=2><strong><i>Change Password</i></strong></td></tr>";
		$retval = $retval."<tr><td colspan=2>Your password should be unique to you and not easily guessed.  Please enter it twice below for verification.</td></tr>";
		$retval = $retval."<tr><td><strong>password:</strong></td><td width=100%><input type=password name=password></td></tr>";
		$retval = $retval."<tr><td><strong>again:</strong></td><td width=100%><input type=password name=password2></td></tr>";
		$retval = $retval."<tr><td colspan=2><center><input type=submit name=\"Change Password\" value=\"Change Password\"></td></tr></form></table>";

		$retval = createItem("Change Password",date("Y-m-d H:i:s"),$retval,null,"blizzle","admin","blizzle",null,null,null,null,null);

	}

} else {

	$retval = "you're not logged in chico.";

}

if ($retval) {
createPage($retval);
}


?>
Return current item: Backend code/CMS for blizzle.com