-
Notifications
You must be signed in to change notification settings - Fork 0
/
insertPaymentDetails.php
68 lines (45 loc) · 1.1 KB
/
insertPaymentDetails.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
<!DOCTYPE html>
<html>
<head>
<title> Order Form Result</title>
<link rel="stylesheet" href="style/style.css" type="text/css" media="screen"/>
</head>
<body>
<div align ="center" id="mainWrapper">
<center>
<?php
include("connect_to_mysql.php");
// Taking all the values from the form data(input)
$NameOnCard = $_REQUEST['name'];
$CardNumber = $_REQUEST['cardNumber'];
$Month = $_REQUEST['Month'];
$Year = $_REQUEST['Year'];
$CVV = $_REQUEST['cvv'];
$Address = $_REQUEST['address'];
// Performing insert query execution
// here our table name is user
$sql = "INSERT INTO payment (NameOnCard, CardNumber, Month, Year,
CVV,Address )
VALUES ('$name','$cardNumber','$Month',
'$Year','$CVV','$Address'
)";
if(mysqli_query($conn, $sql)){
echo "<h3>Please confirm your Payment Details here: </h3>";
echo nl2br("\nNameOnCard : $name\n
CardNumber : $cardNumber\n
Month : $Month\n
Year : $Year\n
");
}
else{
echo "ERROR: Hush! Sorry $sql. "
. mysqli_error($conn);
}
// Close connection
mysqli_close($conn);
?>
</center>
</div>
</div>
</body>
</html>