View file public_html/vipadz/cpass.php

File size: 1.7Kb
<?php

/************************************

Script : Adnetwork
Website : http://facebook.com/pranto007

Script is created and provided by Pranto (http://facebook.com/pranto007)
**************************************/

include '../db.php';
include '../functions.php';

headtag("$SiteName - Change Password");

if($adminlog==1){
echo '<div class="title">Change Password</div>';
 $aid=dump_adata("id");

 if(isset($_POST['newpwd1']) AND isset($_POST['newpwd2']) AND isset($_POST['oldpass'])){

  $newpwd1=formpost("newpwd1");
  $newpwd2=formpost("newpwd2");  
  $oldpass=formpost("oldpass");

  $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(md5($oldpass) != dump_adata("pass"))
{
$errors[] = 'Old Password Wrong';
}

   if(empty($errors)){
      $newpwd=md5($newpwd1);
      $uppwd=mysql_query("UPDATE staff SET pass='$newpwd' WHERE id='$aid'");
      if($uppwd){
         echo '<div class="success">Password Changed! <a href="login.php">Please Login</a></div>';
       session_destroy();
       }
      else {
         echo 'unk';
       }
    }
    else {
      dump_error($errors);
    }
}
 
echo '<div class="form"><form method="post">Old Password:<br/><input type="password" name="oldpass"/><br/>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 '<div class="page"><a href="index.php"> Go Back To Home</a></div>';

include '../foot.php';


}

else {

header('Location:/');
}
?>