-
Notifications
You must be signed in to change notification settings - Fork 0
/
add-addr.php
37 lines (24 loc) · 1.15 KB
/
add-addr.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
<?php
session_start();
print_r($_SESSION);
if (isset($_POST['add_addr'])) {
extract($_POST);
$sql = "INSERT INTO `address` (`addr_name`, `customer_id`, `region`, `city`, `area`, `street`, `house No`, `addr_description`) VALUES ( '$addr_name', '$customer_id', '$region', '$city', '$area', '$street', '$house', '$addr_description')";
include 'config.php';
echo $sql;
$conn->query($sql);
}
?>
<form method="post">
<input type="text" name="addr_name" placeholder="addr_name" class="form-control">
<input type="hidden" name="customer_id" value='<?=$_SESSION['customer']['id']?>'>
<input type="text" name="region" placeholder="region" class="form-control">
<input type="text" name="city" placeholder="city" class="form-control">
<input type="text" name="area" placeholder="area" class="form-control">
<input type="text" name="street" placeholder="street" class="form-control">
<input type="text" name="house" placeholder="house" class="form-control">
<input type="text" name="addr_description" placeholder="addr_description" class="form-control">
<button name="add_addr" value="submit">submit</button>
</form>
<?php
unset($_POST);?>