-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchguse.php
47 lines (40 loc) · 946 Bytes
/
chguse.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
47
<?php
session_start();
$bchgp=$_POST['bchgp'];
$bchgcp=$_POST['bchgcp'];
$usernaa=$_SESSION['userna'] ;
$passnaa=$_SESSION['passna'] ;
if(!empty($bchgp) && !empty($bchgcp)){
$host="localhost";
$dbname="id7285592_kugesh";
$use="id7285592_root";
$pas="11111";
$conn=new mysqli($host,$use,$pas,$dbname);
if(mysqli_connect_error())
{
die('connect error ('.mysqli_connect_error().')');
}
else{
if($bchgp!=$bchgcp){
echo "Username Mismatch";
}
else{
$select2="DELETE FROM reg WHERE user='".$usernaa."'";
$ins = "INSERT INTO reg(pass,user) values('$passnaa','$bchgp')";
$res2=$conn->query($select2);
$res=$conn->query($ins);
//$row = $res->fetch_assoc();
if($res){
echo "Successfully Changed";
}
else{
echo "Failed";
}
$conn->close();
}
}
}
else{
echo "enter Valid Data";
}
?>