-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckout.php
75 lines (68 loc) · 2.54 KB
/
checkout.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
<?php
require_once("server.php");
$address = "";
$name = "";
$cnum = 0;
if (isset($_POST['pay'])) {
$address = mysqli_real_escape_string($db, $_POST['address']);
$name = mysqli_real_escape_string($db, $_POST['name']);
$cnum = mysqli_real_escape_string($db, $_POST['cnum']);
$query = $db -> query("INSERT INTO creditcard VALUES ('$address', '$name', '$cnum')");
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Payment</title>
<link rel="stylesheet" href="main/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body background="images/logwall.jpg">
<div class="payheader">
<h1>Hello there,<br>Pay Here</h1>
</div>
<div class="flexbox3 pay-box">
<div class="pay-item">
<form class="form" method="post">
<div class="inputs">
<input type="text" name="address" placeholder="Enter address" value="<?php echo $address; ?>" required>
</div>
<div class="inputs">
<input type="text" name="city" placeholder="Enter city" required>
</div>
<div class="inputs">
<input type="text" name="state" placeholder="Enter State" required>
</div>
<div class="inputs">
<input type="text" name="zip" placeholder="Enter Zip" required>
</div>
</form>
</div>
<div class="pay-item1">
<form class="form" method="post">
<div class="inputs">
<input type="text" name="name" placeholder="Enter name on card" value="<?php echo $name; ?>" required>
</div>
<div class="inputs">
<input type="text" name="cnum" placeholder="Enter card number" value="<?php $cnum; ?>" required>
</div>
<div class="inputs">
<input type="text" name="expmonth" placeholder="Enter exp month" required>
</div>
<div class="inputs">
<input type="text" name="expyear" placeholder="Enter exp year" required>
</div>
</form>
</div>
</div>
<form class="form5" method="post" action="paydone.html">
<div class="inputs">
<button type="submit" class="button1" name="pay">Pay</button>
</div>
<div class="member">
<p><a href="cart.php">Your Cart</a></p>
<p><a href="index.php">Back Home</a></p>
</div>
</form>
</body>
</html>