forked from ritthisakdi/faucet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pass.php
79 lines (30 loc) · 920 Bytes
/
pass.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
require_once "header.php";
require_once "maincore.php";
require_once "includes/dbconnector.class.php";
$db=new DbConnector;
if( isset($_POST['newpassword'] ) ){
$newpass=md5($_POST['newpassword']);
$prepass=md5($_POST['prepass']);
if($userdet['password']==$prepass){
$prepass=$db->mysqli->prepare("update tbl_user set password=? where user_id=? ");
$prepass->bind_param('si',$newpass,$uid);
$prepass->execute();
$prepass->close();
$_SESSION['succ']['change']=true;
}else{
$_SESSION['error']['wrong']=true;
}
header('Location:pass.php');
}else{
if(isset($_SESSION['error']['wrong'])){
$smarty->assign('wrong',true);
unset($_SESSION['error']);
}
if(isset($_SESSION['succ']['change'])){
$smarty->assign('succ',true);
unset($_SESSION['succ']);
}
$smarty->display('template/pass.tpl');
}
?>