Skip to content

Instantly share code, notes, and snippets.

@komly
Created May 3, 2016 11:16
Show Gist options
  • Select an option

  • Save komly/0bf3450184b0de0c3b648226dc7ca646 to your computer and use it in GitHub Desktop.

Select an option

Save komly/0bf3450184b0de0c3b648226dc7ca646 to your computer and use it in GitHub Desktop.
<?php
function authMiddleware($get) {
if (!isset($get['key']) || $get['key'] != 'secret') {
return 'Unauthorized';
}
return handleRequest($get);
}
function handleRequest($get) {
return '<h1>My home page</h1>';
}
$res = authMiddleware(handleRequest($_GET));
echo $res;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment