PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Alireza Nasseh   Iran National ID Check   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Sample usage
Class: Iran National ID Check
Check if a national ID from Iran can be valid
Author: By
Last change:
Date: 7 years ago
Size: 963 bytes


Class file image Download
 * Created by PhpStorm.
 * User: Alireza Nasseh
 * Date: 12/1/2015
 * Time: 9:05 PM


$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>";
$mess = "<p class='error'>$code is not a valid national ID number!</p>";
    <meta charset="UTF-8" />
    <style type="text/css">
        body, input {
        .success { color:green }
        .error { color:red }
    <title>National ID Validity Check</title>
<?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"/>