65535){ $jsone['result'] = "Fail"; $jsone['message'] = "You have entered a over value on " . $id . ", it should be less than 65535"; echo json_encode($jsone); exit; } if($_POST[$id]<0){ $jsone['result'] = "Fail"; $jsone['message'] = "You have entered a over value on " . $id . ", it should be more than 0"; echo json_encode($jsone); exit; } } } function checkValue($id){ if($_POST[$id] != ""){ if(strlen($_POST[$id])!=1){ $jsone['result'] = "Fail"; $jsone['message'] = "You have entered a wrong value on " . $id . ", it should be numeric"; echo json_encode($jsone); exit; } if(!ereg("[0-9]",$_POST[$id])){ $jsone['result'] = "Fail"; $jsone['message'] = "You have entered a wrong value on " . $id . ", it should be numeric"; echo json_encode($jsone); exit; } } } function checkLength($id){ if($_POST[$id] != ""){ if(strlen($_POST[$id])>32){ $jsone['result'] = "Fail"; $jsone['message'] = "You have entered a wrong value on " . $id . ", it should be less than 32 bytes"; echo json_encode($jsone); exit; } } } ?>