-
Notifications
You must be signed in to change notification settings - Fork 0
/
orderphp.php
50 lines (45 loc) · 1.3 KB
/
orderphp.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
<html>
<head>
<title>OTP entry</title>
<style type="text/css">
body{
background-image:url("otpbg.png");
background-repeat: no-repeat;
background-size:cover;
}
</style>
</head>
<body>
<center><h3><?php echo "An OTP has been sent to your mobile number:{$_POST["mobilenum"]}"?></h3> <br />
<h3><?php echo "The OTP will last only for five minutes" ?></h3><br/></center>
<form name=otp id=otp method="post" action="otp.php">
<h2><center>Enter your OTP:<input type="number" name="otp" maxlength="6" pattern="[0-9]{6}" onkeyup="this.value = this.value.replace(/[^0-9]/, '')" required></center></h2>
<center><input type="submit" name="Proceed to Pay" value="Proceed to pay"></center>
</form>
<?php
$dbname="card";
$servername = "localhost";
$username = "root";
$password = "";
$cardname=$_POST["firstname"];
$cardnumber=$_POST["cnum"];
$cvnumber=$_POST["cvv"];
$mobile=$_POST["mobilenum"];
$date=$_POST["exp"];
// Create connection
$conn = mysqli_connect($servername, $username, $password,$dbname);
if(!$conn){
echo"Failed"."<br>";
}
$sql="INSERT INTO details(name,cnumber,cvvnumber,mnum,expiry)
VALUES('$cardname','$cardnumber','$cvnumber','$mobile','$date')";
if(mysqli_query($conn,$sql)){
echo "Successful";
}
else{
echo "Error";
}
mysqli_close($conn);
?>
</body>
</html>