-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdateUserScript.php
More file actions
64 lines (59 loc) · 2.44 KB
/
updateUserScript.php
File metadata and controls
64 lines (59 loc) · 2.44 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "isdm";
$con = mysqli_connect($servername, $username, $password, $dbname);
// $name = $_REQUEST["q"];
// $gender = $_REQUEST["r"];
// $dob = $_REQUEST["s"];
$mobileno = $_REQUEST["q"];
$billstreet = $_REQUEST["r"];
$billcity = $_REQUEST["s"];
$billstate = $_REQUEST["t"];
$billzip = $_REQUEST["u"];
$delstreet = $_REQUEST["v"];
$delcity = $_REQUEST["w"];
$delstate = $_REQUEST["x"];
$delzip = $_REQUEST["y"];
session_start();
$uname = $_SESSION['user_name'];
// echo "$name,$dob";
if($mobileno!=null){
if (strlen($mobileno) != 10){
echo "Incorrect Number Format";
return;
}
else
$r1 = mysqli_query($con, "update customer set cmobileno = $mobileno where cusername='$uname' ") or die("q1 error");
}
if($billstreet!=null)
$r2 = mysqli_query($con, "update address set street = '$billstreet' where addid in (select billingaddid from customer where cusername='$uname')") or die("q2 error");
if($billcity!=null)
$r3 = mysqli_query($con, "update address set city = '$billcity' where addid in (select billingaddid from customer where cusername='$uname')") or die("q3 error");
if($billstate!=null)
$r4 = mysqli_query($con, "update address set state = '$billstate' where addid in (select billingaddid from customer where cusername='$uname')") or die("q4 error");
if($billzip!=null){
if (strlen($billzip) != 6){
echo "Incorrect ZipCode Format";
return;
}
else
$r5 = mysqli_query($con, "update address set zipcode = '$billzip' where addid in (select billingaddid from customer where cusername='$uname')") or die("q5 error");
}
if($delstreet!=null)
$r6 = mysqli_query($con, "update address set street = '$delstreet' where addid in (select deliveryaddid from customer where cusername='$uname')") or die("q6 error");
if($delcity!=null)
$r7 = mysqli_query($con, "update address set city = '$delcity' where addid in (select deliveryaddid from customer where cusername='$uname')") or die("q7 error");
if($delstate!=null)
$r8 = mysqli_query($con, "update address set state = '$delstate' where addid in (select deliveryaddid from customer where cusername='$uname')") or die("q8 error");
if($delzip!=null){
if (strlen($billzip) != 6){
echo "Incorrect ZipCode Format";
return;
}
else
$r9 = mysqli_query($con, "update address set zipcode = '$delzip' where addid in (select deliveryaddid from customer where cusername='$uname')") or die("q9 error");
}
echo "Successfuly updated :)";
?>