
PK 
<?php
if($_POST[submt_btn] == 1){
$p1=$_POST['p1'];
$p2=$_POST['p2'];
if ($p1!=$p2){
$errmsg="<b>Error:<br><br>Your password did not match.";
}
$query="select * from admin where pass='$_POST[oldp]' and user='".$_SESSION["logged_user"]."'";
$q=mysql_query("$query") or die(mysql_error());
if(mysql_num_rows($q)>0){
$query="update admin set pass='$p1' where user='".$_SESSION["logged_user"]."'";
mysql_query("$query") or die(mysql_error());
$msg="Password update successfully";
}else{
$errmsg="Invalid Old password.";
}
}
?>
<div class="page-content-wrapper">
<div class="page-content">
<!-- BEGIN PAGE HEADER-->
<h3 class="page-title">Change Password <small></small></h3>
<!-- END PAGE HEADER-->
<!-- BEGIN PAGE CONTENT-->
<div class="row">
<div class="col-md-12">
<!-- BEGIN EXTRAS PORTLET-->
<?php if($msg){?><div class="alert alert-success display-show"><button class="close" data-close="alert"></button><?=$msg?></div><?php }?>
<?php if($errmsg){?><div class="alert alert-error"><strong>Error!</strong> <?php echo $errmsg?></div><?php }?>
<div class="portlet box blue-hoki">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-gift"></i>Change Password
</div>
</div>
<div class="portlet-body form">
<form class="form-horizontal form-bordered" enctype="multipart/form-data" method="post" >
<input type="hidden" name="doAction" value="<?php echo ($_GET[article_id]!=""?"edit":"add")?>">
<input type="hidden" name="typ" value="<?php echo ($_GET[article_id]!=""?$editrow[typ]:$_REQUEST[typ])?>">
<div class="form-body">
<div class="form-group">
<label class="control-label col-md-2">User</label>
<div class="col-md-10"><?php echo $_SESSION["logged_user"]?></div>
</div>
<div class="form-group">
<label class="control-label col-md-2">Old Password</label>
<div class="col-md-10">
<input type="password" class="form-control" required name="oldp" id="oldp" />
</div>
</div>
<div class="form-group">
<label class="control-label col-md-2">New Password</label>
<div class="col-md-10">
<input type="password" class="form-control" name="p1" id="p1" />
</div>
</div>
<div class="form-group">
<label class="control-label col-md-2">Retype New Password</label>
<div class="col-md-10">
<input type="password" class="form-control" name="p2" id="p2" />
</div>
</div>
<div class="form-actions">
<div class="row">
<div class="col-md-offset-2 col-md-10">
<button type="submit" name="submt_btn" value="1" class="btn green"><i class="fa fa-check"></i> Change Password</button>
<button type="button" class="btn default">Cancel</button>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- END PAGE CONTENT-->
</div>
</div>
<!-- END CONTENT -->


PK 99