File size: 1.65Kb
<?php
/************************************
Script : Adnetwork
Website : http://facebook.com/mohd.arshadsaifi79
Script is created and provided by Arshad (http://facebook.com/mohd.arshadsaifi79)
**************************************/
include '../db.php';
include '../functions.php';
headtag("$SiteName - Change Password");
if($adminlog==1){
echo '<div class="title">Change Password</div>';
$uid=formget("id");
if(dump_adata("rank")=='1')
{
if(isset($_POST['newpwd1']) AND isset($_POST['newpwd2'])){
$newpwd1=formpost("newpwd1");
$newpwd2=formpost("newpwd2");
$errors=array();
if(strlen($newpwd1)<1){
$errors[]='Password cannot be empty!';
}
if(strlen($newpwd2)<1){
$errors[]='Verify Password cannot be empty!';
}
if($newpwd1!=$newpwd2){
$errors[]='Passwords did not match!';
}
if(empty($errors)){
$newpwd=md5($newpwd1);
$uppwd=mysql_query("UPDATE userdata SET password='$newpwd' WHERE id='$uid'");
if($uppwd){
echo '<div class="success">Password Changed Successfully!</div>';
}
else {
echo 'unk';
}
}
else {
dump_error($errors);
}
}
echo '<div class="form"><form method="post">New Password:<br/><input type="password" name="newpwd1"/><br/>Verify New Password:<br/><input type="password" name="newpwd2"/><br/><input type="submit" value="Change"/></form></div>';
echo '<a href="user.php?id='.$uid.'"><div class="ua">User Details</div></a>';
include '../foot.php';
}
else {
echo '<div class="error">Access Denied</div>';
echo '<div class="page"><a href="index.php"> Go Back To Home</a></div>';
include '../foot.php';
}
}
else {
header('Location:/');
}
?>