Location: PHPKode > projects > EasyFest > new/change_password_action.php
<?php
include_once("include/db_connection.php");
	header("Expires: Thu, 17 May 2001 10:17:17 GMT");    // Date in the past
	header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
	header ("Cache-Control: no-cache, must-revalidate");  // HTTP/1.1
	header ("Pragma: no-cache");                          // HTTP/1.0              
	session_start();
	if($_SESSION["adminloggedIn"] == FALSE){
		header("Location:admin_login.php");
		exit;
	}
			include('header.php');
	include('left1.php');
	
//if($_SESSION["loggedIn"] !="true"){
//header("Location: admin_login.php");
//}

?>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Premium Series by Free CSS Templates</title>
<meta name="keywords" content="" />
<meta name="Premium Series" content="" />
<link href="default.css" rel="stylesheet" type="text/css" media="screen" />

<script language="JavaScript" src="gen_validatorv31.js" type="text/javascript"></script>

</script>
</head>

<body>
<div id="wrapper">
	<!-- start page -->
	<div id="page">
    	  <!-- start content -->
        <div id="prtCnt" align="center">
		<div id="content" align="center">
		  <div class="post">
	    <h2 class="title">&nbsp;</h2>
	    <div class="entry">

<br>
<br>
<br>
<p align="center">
<?php
	//if(isset($_GET['cur_password']) && isset($_GET['newpassword']) && isset($_GET['retypepassword'])){
		{	$uid = $_SESSION['UserName'];
			$curPwd = $_REQUEST['cur_password'];
			$newPwd = $_REQUEST['new_password'];
			$retypePwd = $_REQUEST['con_password'];
			
			
			//$mdnewPwd = md5($newPwd);
			//$mdcurPwd = md5($curPwd);
			//$mdretypePwd = md5($retypePwd);
			//$pwd =  MYSQL_RESULT("SELECT * FROM 'users' WHERE 'UserName' = '$uid'", 1 , "Password");
			
			
			$sqlEditPwd = "SELECT * FROM `users` WHERE `UserName` = '$uid'";
			//$pass = $sqlEditpwd['Password'];
			//echo "$pass"; 
			
			$resultEditPwd = MYSQL_QUERY($sqlEditPwd);
			
			echo $resultEditpwd;
			
			$pwd = MYSQL_RESULT($resultEditPwd,"0","Password");
			
			//echo $pwd;
			//echo $pwd;
			//echo $pwd;
		


//After this we will see that our entered password is not less than 3 char and more that 8 char length.
		
		"<font face='Verdana' size='2' color=red>$msg</font><br><center><input type='button' value='Retry' onClick='history.go(-1)'></center>";
		
			
			if($pwd != $curPwd){
				echo "<font face='Verdana' size='2' color=red>You have entered a wrong password</font><BR><center><input type='button' value='Retry' onClick='history.go(-1)'></center>";
				return ;
			}
			if ( strlen($newPwd) < 3 or strlen($newPwd) > 15 ){
  				echo "<font face='Verdana' size='2' color=red>Password must be more than 3 char legth and maximum 15 char length</font><BR><center><input type='button' value='Retry' onClick='history.go(-1)'></center>";
			return ;
			}
	
			if($newPwd != $retypePwd){
				echo "<font face='Verdana' size='2' color=red>Please reenter your new password, Your new password doesnot matches with your confirm new password</font><BR><center><input type='button' value='Retry' onClick='history.go(-1)'></center>";
				return;
			}
			if(($newPwd == $retypePwd) && ($pwd == $curPwd)){
				$sqlEditPwd = "UPDATE `users` SET `Password` = '$newPwd' WHERE `UserName` = '$uid'";
				$resultEditPwd = MYSQL_QUERY($sqlEditPwd);
			echo "<font face='Verdana' size='2' color=green>You have Successfully changed your password!!!</font><BR>";
			}
		}
		
?>
</p>
                    </p>
				</div>
		  </div>
		</div>
        </div>
        <!-- end content -->
		<!-- start sidebars -->
		<!-- end sidebars -->
	  <div style="clear: both;">&nbsp;</div>
	</div>
	<!-- end page -->
</div>

</body>

</html>
<?php
	include('footer.php');
?>
Return current item: EasyFest