-
Notifications
You must be signed in to change notification settings - Fork 1
/
changepwd.php
46 lines (38 loc) · 971 Bytes
/
changepwd.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
41
42
43
44
45
46
<?php
session_start();
include 'dbms_server_conn.php';
$m_no=$_SESSION['user'];
$old=$_GET["old"];
$new=$_GET["new"];
$cnfnew=$_GET["cnfnew"];
$querry= "SELECT * from hashcash.user where mobilenumber=$m_no AND password=$old";
$result = mysqli_query($con,$querry);
if(!$result)
{
echo mysqli_error($result);
mysqli_close($con);
}
else
{
if($new!=$cnfnew){
echo ("<script LANGUAGE='JavaScript'>
window.alert('Password Mismatch');
window.location.href='profile.php';
</script>");
mysqli_close($con);
}
$querry2= "UPDATE hashcash.user SET password=$new where mobilenumber=$m_no AND password=$old";
$result2 = mysqli_query($con,$querry2);
if(!$result2)
{
echo mysqli_error($result2);
mysqli_close($con);
}
else
{#echo "Password Updated";
echo ("<script LANGUAGE='JavaScript'>
window.alert('Password Updated');
window.location.href='profile.php';
</script>");}
}
mysqli_close($con);