function check_legal($id = null) { if (!$id) { exit('<script>window.location.href="../erroroccur.php";</script>'); } elseif (check_inject($id)) { exit('<script>window.location.href="../erroroccur.php";</script>'); } return $id; }
function check_num($id = null) { if (!$id) { exit('<script>window.location.href="../erroroccur.php";</script>'); } elseif (check_inject($id)) { exit('<script>window.location.href="../erroroccur.php";</script>'); } elseif (!is_numeric($id)) { exit('<script>window.location.href="../erroroccur.php";</script>'); } $id = intval($id); return $id; }