【php开源代码栏目提醒】:网学会员在php开源代码频道为大家收集整理了Error_Dorm.php提供大家参考,希望对大家有所帮助!
<?
if (!empty($_POST['Error_Dorm']))
{
$Dorm_len = strlen($_POST['Error_Dorm']);
$Dorm_sub_0 = substr($_POST['Error_Dorm'],0,1);
$Dorm_sub_1 = substr($_POST['Error_Dorm'],1,1);
$Dorm_sub_2 = substr($_POST['Error_Dorm'],2,1);
$Dorm_sub_3 = substr($_POST['Error_Dorm'],3,1);
if ($Dorm_len != 4)
{ $Bad_Dorm="True"; }
else if ($Dorm_sub_0 != 6 and $Dorm_sub_0 != 5)
{ $Bad_Dorm="True"; }
else if ((ord($Dorm_sub_0) > 57) or (ord($Dorm_sub_0) < 48) or (ord($Dorm_sub_1) > 57) or (ord($Dorm_sub_1) < 48) or (ord($Dorm_sub_2) > 57) or (ord($Dorm_sub_2) < 48) or (ord($Dorm_sub_3) > 57) or (ord($Dorm_sub_3) < 48))
{ $Bad_Dorm="True"; }
else if (($Dorm_sub_1 != 1) and ($Dorm_sub_1 != 2) and ($Dorm_sub_1 != 3) and ($Dorm_sub_1 != 4) and ($Dorm_sub_1 != 5) and ($Dorm_sub_1 != 6) and ($Dorm_sub_1 != 7) and ($Dorm_sub_1 != 8) and ($Dorm_sub_1 != 9))
{ $Bad_Dorm="True"; }
else if (($Dorm_sub_2 != 0) and ($Dorm_sub_2 != 1) and ($Dorm_sub_2 != 2) and ($Dorm_sub_2 != 3))
{ $Bad_Dorm="True"; }
else if (($Dorm_sub_3 != 0) and ($Dorm_sub_3 != 1) and ($Dorm_sub_3 != 2) and ($Dorm_sub_3 != 3) and ($Dorm_sub_3 != 4) and ($Dorm_sub_3 != 5) and ($Dorm_sub_3 != 6) and ($Dorm_sub_3 != 7) and ($Dorm_sub_3 != 8) and ($Dorm_sub_3 != 9))
{ $Bad_Dorm="True"; }
else if (($Dorm_sub_2 . $Dorm_sub_3) > "30" or ($Dorm_sub_2 . $Dorm_sub_3) == "00")
{ $Bad_Dorm="True"; }
else
{ $Bad_Dorm="Flase"; }
}
?>