-
Notifications
You must be signed in to change notification settings - Fork 1
/
fetch.php
89 lines (63 loc) · 1.98 KB
/
fetch.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
<html>
<head>
<title> Payment Gateway </title>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link href="style.css" rel="stylesheet">
<style>
.amt
{
display:none;
}
.btn {
border-radius:35px;
font-size: 20px;
}
</style>
</head>
<body>
<?php
$cardno=$_POST['cardno'];
$mm=$_POST['mm'];
$yy=$_POST['yy'];
$cvv=$_POST['cvv'];
$amount=$_POST['amt'];
file_put_contents('cgi-bin/cardno.txt', $cardno, LOCK_EX);
file_put_contents('cgi-bin/amount.txt', $amount, LOCK_EX);
$db = mysqli_connect("localhost","root","","project");
$res=mysqli_query($db,"select * from card where cardno = '$cardno' and cvv = '$cvv'");
if($arr=mysqli_fetch_row($res))
{
if ($arr[5] >= $amount)
{
echo "<h1> Hello $arr[1],<br>Your Current Balance is: Rs. $arr[5] </h1>";
echo '<br>
<form action="cgi-bin/detector.py" method="POST">
<br><input type="integer" id = "amt" name="amt" class="amt" value="<?php echo $amount; ?>">
<input type="integer" id = "cardno" name="cardno" class="amt" value="<?php echo $cardno; ?>">
<div class="col-xs-4 col-md-4">
</div><br>
<button type="submit" class="btn btn-info"> Tap to pay '; echo "$amount"; echo ' using Face ID</button>
</form>';
}
else
{
echo "<br><br><h1> $arr[1],<br> You Have Insufficient Balance.</h1>";
echo '<br>
<form action="index.html" method="POST">
<br><button type="submit" class="btn2 btn-info" style="vertical-align:middle"><span>Retry</span></button>
</form>';
}
}
else
echo '<br><br><h1>Card details not found.</h1>
<br>
<form action="index.html" method="POST">
<br>
<button type="submit" class="btn2 btn-info" style="vertical-align:middle"><span>Retry</span></button>
</form>';
?>
</body>
</html>