I threw this together really quick, but hopefully it works.
PHP Code:
<?php
//check to see if the form has been set
if(isset($_POST['submit'])){
#CONNECT TO MYSQL HERE
//get first 4 numbers
$credit = preg_split("/[\D{5}]/",$_POST['number']);
//look in mysql for the numbers
$rows = MySQL_query("SELECT * FROM table WHERE number = \"".$credit[0]."\"");
//see if there was at least one match
if(MySQL_num_rows($rows) <= 1){\
die('FOUND A MATCH FOR THE CREDIT CARD NUMBER');
}else{
//process the info
}
}else{
echo "<form action='".$_SERVER['PHP_SELF']."' method='POST'>
<input type='text' name='number'>
<input type='submit' name='submit' value='submit'>
</form>";
}
?>
Bookmarks