<html>
<body>
<form name="form1" method="post" action="xtra assign.php">
<h1>Malaysia Identification Card(IC)</h1>
Enter IC NO : <input type="text" name="IC" id="IC"><br>
<input type="submit" name="submit" value="submit">
<input type="reset" name="clear" value="clear">
</form>
</body>
</html>
In this php , I need to add 3 functions: is_numeric,substr and strlen, but I get so many errors. Also i also i need to make difference if the end number is even or odd. if the end number is odd, it is gentlement, if the end number is even, it is a lady.
<?php
if(isset($_POST['submit']))
{
$IC=$_POST['IC'];
substr($IC,-1);
$IC=123456789012;
can i use this code?
if(is_numeric($IC) &&strlen($IC===12))
{
echo"CARD HOLDER IS A GENTLEMAN";
}
can i use this the same like if?
else (is_numeric($IC) &&strlen($IC===12) &&substr($IC,-1))
{
echo "CARD HOLDER IS A LADY";
}
else
{
echo "THE IC NUMBER IS INVALID";
}
}
?>