-
Notifications
You must be signed in to change notification settings - Fork 0
/
paypage.php
123 lines (103 loc) · 4.76 KB
/
paypage.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
114
115
116
117
118
119
120
121
122
123
<!DOCTYPE html>
<html>
<head>
<title> </title>
<link rel="stylesheet" href="paypage.css">
</head>
<body>
<!-- payment start -->
<div class="container">
<form action="paypage.php" method="post">
<div class="mainForm">
<div class="left">
<h3>BILLING ADDRESS</h3>
Full name :
<input id="full" type="text" name="full" placeholder="Enter name" >
Email :
<input id="em" type="text" name="mail" placeholder="Enter email" >
Address :
<input id="add" type="text" name="add" placeholder="Enter address" >
City :
<input id="cit" type="text" name="city" placeholder="Enter City" >
<div id="zip">
<label>
Province
<select name="pro">
<option>Western </option>
<option>Southern</option>
<option>Sabaragamuwa</option>
<option>Uva</option>
<option>Central</option>
<option>North Western</option>
<option>North Central</option>
<option>Eastern</option>
<option>Northern</option>
</select>
</label>
<label>
Zip Code :
<input id="cd" type="number" name="zip" placeholder="zip code">
</label>
</div>
</div>
<div class="right">
<h3>PAYMENT</h3>
Accepted Card :<br>
<input type="radio" id="master" name="card" value="master">
<img src="mcard.png" width="50">
<input type="radio" id="visa" name="card" value="visa">
<img src="vcard.png" width="50">
<br><br>
Credit Card number :
<input id="cc" type="text" name="cardno" placeholder="Enter card number" maxlength="16">
Exp Month:
<input id="mm" type="text" name="exm" placeholder="Enter Month" >
<div id="zip">
<label>
Exp Year
<select name="exy">
<option>Choose Year </option>
<option>2025</option>
<option>2026</option>
<option>2027</option>
<option>2028</option>
<option>2029</option>
<option>2030</option>
</select>
</label>
<label>
CVV :
<input id="cv" type="number" name="cv" placeholder="CVV" maxlength="16" >
</label>
</div>
<br><input type="submit" name="paynow" id="sub" class="btn" value="PAY">
</div>
</div>
</form>
</div>
</body>
</html>
<?php
require 'connection.php';
if(isset($_POST['paynow'])){
$fullname=$_POST['full'];
$email=$_POST['mail'];
$address=$_POST['add'];
$city=$_POST['city'];
$province=$_POST['pro'];
$zipcode=$_POST['zip'];
$typecard=$_POST['card'];
$cardnumber=$_POST['cardno'];
$expmonth=$_POST['exm'];
$expyear=$_POST['exy'];
$cvv=$_POST['cv'];
$sql="INSERT INTO payment VALUES('','$fullname','$email','$address','$city','$province','$zipcode','$typecard','$cardnumber','$expmonth','$expyear','$cvv')";
//mysqli_query($conn, $sql);
if(mysqli_query($conn, $sql) === true) {
die( "<script> alert('Data inserted successfully')</script>");
}
else{
echo"Error";
}
}
?>