-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
110 lines (93 loc) · 3.54 KB
/
index.php
File metadata and controls
110 lines (93 loc) · 3.54 KB
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
<?php
if (isset($_POST['submitbutton'])) {
$number= $_POST['number_entered'];
if (validatecard($number) !== false) {
$success = " $type, credit card number is valid";
}else{
$error = " This credit card number is invalid";
}
validatecard($number);
}
// $submitbutton= $_POST['submitbutton'];
function validatecard($number)
{
global $type;
$cardtype = array(
"visa" => "/^4[0-9]{12}(?:[0-9]{3})?$/",
"mastercard" => "/^5[1-5][0-9]{14}$/",
"amex" => "/^3[47][0-9]{13}$/",
"discover" => "/^6(?:011|5[0-9]{2})[0-9]{12}$/",
);
if (preg_match($cardtype['visa'],$number))
{
$type= "vsisa";
return 'visa';
}
else if (preg_match($cardtype['mastercard'],$number))
{
$type= "mastercard";
return 'mastercard';
}
else if (preg_match($cardtype['amex'],$number))
{
$type= "amex";
return 'amex';
}
else if (preg_match($cardtype['discover'],$number))
{
$type= "discover";
return 'discover';
}
else
{
return false;
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Credit Card Checker</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<br>
<div class="container">
<form method="POST" action="">
<div class="container">
<center><a class="" style="" href="index.php"><img class="image" src="img/cc.png" style="height: 40px;"></a></center>
<h2 class="text-center text-muted" style="font-size: 15px;">Credit Card Checker</h2>
<hr>
<div id="data"></div>
<div class="form-group">
<label for="card"><b>Card No</b></label>
<input type="text" placeholder="Enter Credit Card" name="number_entered" class="form-control" maxlength="16" style="height: 46px;margin-bottom: 0px;" onkeyup="checkcard(this.value)">
</div>
</div>
<script type="text/javascript">
function checkcard(number_entered){
$.get( "check.php?number_entered="+number_entered, function( data ) {
$( "#data" ).html( data );
// alert( "Load was performed." );
});
}
</script>
<!-- <button type="submit" name="submitbutton" id="check" class="btn loginbtn">Check</button> -->
<hr>
<div class="container signin" style="padding: 15px;">
<p>Developed by <a href="https://www.facebook.com/greychukz">Chuks Okwuenu</a>.</p>
</div>
</div>
</form>
</div>
</body>
</html>