-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathshipping_info.php
113 lines (112 loc) · 3.87 KB
/
shipping_info.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
include('topmenu.php');
if(session_status() == PHP_SESSION_NONE) {
session_start();
}
if(isset($_SESSION['cartamount'])) {
$cartamount = $_SESSION['cartamount'];
}
$connection = mysqli_connect("localhost", "root", "", "shopping") or die("Check sql connection!");
$email_address = "";
if(isset($_SESSION['emailaddress'])) {
$email_address = $_SESSION['emailaddress'];
}
if(isset($_SESSION['password'])) {
$password = $_SESSION['password'];
}
if((isset($_SESSION['emailaddress']) && $_SESSION['emailaddress'] != "") || (isset($_SESSION['password']) && $_SESSION['password'] != "")) {
$query = "select * from customers where email_address like '$email_address' and password like (PASSWORD('$password'))";
$results = mysqli_query($connection, $query) or die(mysql_error());
$row = mysqli_fetch_assoc($results);
extract($row);
?>
<form action="purchase.php" method="post">
<table border="0" cellspacing="1" cellpadding="3">
<tr><td colspan="2" align="center">Your information as given:</td></tr>
<tr>
<td>Email address: </td>
<td><input size="20" type="text" name="email_address" value="<?php echo $email_address; ?>"></td>
</tr>
<tr>
<td>Complete name: </td>
<td><input size="50" type="text" name="complete_name" value="<?php echo $complete_name; ?>"></td>
</tr>
<tr>
<td>Address:</td>
<td><input size="80" type="text" name="address1"
value="<?php echo $address_line1; ?>"></td>
</tr>
<tr>
<td></td>
<td><input size="80" type="text" name="address2" value="<?php
echo $address_line2; ?>"></td>
</tr>
<tr>
<td>City:</td>
<td><input size="30" type="text" name="city"
value="<?php echo $city; ?>"></td>
</tr>
<tr>
<td>State:</td>
<td><input size="30" type="text" name="state"
value="<?php echo $state; ?>"></td>
</tr>
<tr>
<td>Country:</td>
<td><input size="30" type="text" name="country"
value="<?php echo $country; ?>"></td>
</tr>
<tr>
<td>Zip Code:</td>
<td><input size="20" type="text" name="zipcode"
value="<?php echo $zipcode; ?>"></td>
</tr>
<tr>
<td>Phone No:</td>
<td><input size="30" type="text" name="phone_no"
value="<?php echo $cellphone_no; ?>"></td>
</tr>
<tr>
<td colspan=2 align="center">Please update shipping information if
different from the shown below: </td>
</tr>
<tr>
<td> Address to deliver at: </td>
<td><input type="text" size="80" name="shipping_address_line1" value="<?php echo $address_line1; ?>"></td>
</tr>
<tr>
<td></td>
<td><input type="text" size="80" name="shipping_address_line2" value="<?php echo $address_line2; ?>"></td>
</tr>
<tr>
<td> City: </td>
<td><input size="30" type="text"
name="shipping_city" value="<?php echo $city; ?>"></td>
</tr>
<tr>
<td> State: </td>
<td><input size="30" type="text"
name="shipping_state" value="<?php echo $state; ?>"></td>
</tr>
<tr>
<td> Country: </td>
<td><input size="30" type="text"
name="shipping_country" value="<?php echo $country; ?>"></td>
</tr>
<tr>
<td> Zip Code: </td>
<td><input type="text" size="20"
name="shipping_zipcode" value="<?php echo $zipcode; ?>"></td>
</tr>
<tr>
<td><input type="submit" name="submit" value="Supply Payment
Information"></td>
<td><input type="reset" value="Cancel"></td>
</tr>
</table>
</form>
<?php
}
?>
</body>
</html>