-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathup.php
40 lines (31 loc) · 1.08 KB
/
up.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
session_start();
include("connection.php");
include("functions.php");
if(isset($_POST['s2']))
{$sql=$con->adb->users1->updateOne(['user_name'=>$_SESSION['username']],['$set'=>['passwordd'=>$_POST['password']]]);
//result=pg_query($con,$sql);
echo "<script>
alert('Password updated!');
window.location.href='uupdate.php';
</script>";
}
if(isset($_POST['s1']))
{
$sql=$con->adb->users1->updateOne(['user_name'=>$_SESSION['username']],['$set'=>['user_name'=>$_POST['user_name']]]);
//$result=pg_query($con,$sql);
/*$sql1="select * from icart where username='$_SESSION[username]'";
$result1=pg_query($con,$sql1);
if($result1 && pg_num_rows($result1) > 0)
{
$sql3="UPDATE icart SET user_name='$_POST[user_name]'
where user_name='$_SESSION[username]'";
$res=pg_query($con,$sql3);
}*/
$_SESSION['username']=$_POST['user_name'];
echo "<script>
alert('Username updated!');
window.location.href='uupdate.php';
</script>";
}
?>