<?php
/**
* Created by PhpStorm.
* User: Alireza Nasseh
* Date: 12/1/2015
* Time: 9:05 PM
*/
require("NationalIDCheck.php");
$idCheck = new NationalIDCheck();
$code = strip_tags($_POST["code"]);
if ($code) {
if ($idCheck->check($code)) $mess = "<p class='success'>$code is a valid national ID number.</p>";
else $mess = "<p class='error'>$code is not a valid national ID number!</p>";
}
?>
<html>
<head>
<meta charset="UTF-8" />
<style type="text/css">
body, input {
font-family:tahoma;
font-size:12px;
}
.success { color:green }
.error { color:red }
</style>
<title>National ID Validity Check</title>
</head>
<body>
<?php echo $mess; ?>
<form action="index.php" method=post>
<input type=text name="code" placeholder="National ID Number"/>
<input type=submit name="submit_check" value="Check Validity"/>
</form>
</body>
</html>
|