Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. function sanitize($key, $value){
  2. $safe_types = array(
  3. "month",
  4. "year",
  5. "course",
  6. "pagetype",
  7. "studentid"
  8. );
  9. if (in_array($key, $safe_types)) {
  10. $key = strtoupper($key);
  11. if (is_numeric($value) || preg_match("#^[a-z_]+#", $value)){
  12. define ($key, $value);
  13. }}}
  14. foreach ($_GET as $key => $value) {
  15. sanitize($key, $value);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement