-
Notifications
You must be signed in to change notification settings - Fork 0
/
codechange.php
executable file
·48 lines (44 loc) · 1.11 KB
/
codechange.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
48
<?php
session_start();
require_once("DataConnection.php");
$name=isset($_POST["name_r"])?$_POST["name_r"]:"";
$user=isset($_POST["user_r"])?$_POST["user_r"]:"";
$pass=isset($_POST["pass_r"])?$_POST["pass_r"]:"";
$email=isset($_POST["email_r"])?$_POST["email_r"]:"";
$phone=isset($_POST["phone_r"])?$_POST["phone_r"]:"";
$orname=isset($_POST["orname_r"])?$_POST["orname_r"]:"";
$querycheck="select name,user,email from logins where name!='$name'";
$res=mysqli_query($con,$querycheck);
if($res==true and mysqli_num_rows($res)>0)
{
while($row=mysqli_fetch_array($res))
{
if($row[0]==$name)
{
$err="dup1";
header("location:changeset.php?err=$err");
break;
}
else
if($row[1]==$user)
{
$err="dup2";
header("location:changeset.php?err=$err");
break;
}
else
if($row[0]==$email)
{
$err="dup3";
header("location:changeset.php?err=$err");
break;
}
else
{
$querySelect="update logins set name='$name',user=$user,email='$email',phone='$phone',pass='$pass',orname='$orname' where name='$name'";
$result=mysqli_query($con,$querySelect);
header("location:buysell.php");
}
}
}
?>