Advertisement
Guest User

Untitled

a guest
Feb 14th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.33 KB | None | 0 0
  1. // Variable "id" is set?
  2. if (isset($_GET['id'])) {
  3.  
  4.     // Set variable "id"
  5.     $id = $_GET['id'];
  6.  
  7.     // Create whitelist
  8.     $whitelist = array(1, 3, 5);
  9.  
  10.     // Check if element is in array
  11.     if (in_array($id, $whitelist)) {
  12.         // Do something...
  13.     } else {
  14.         header("Location: http://xyz.de/errorpage");
  15.         die();
  16.     }  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement