PHP Get corresponding data, with default and error handling
问题 I have a normal HTML menu that passes a GET statement to the url. <li><a href="?Page=Home">Home</a></li> Just like this, al though this is ofcourse only 1 item of the entire menu. In a seperated file I have an function that checks if an GET or POST statement exist, and If it exist and is not NULL then it will give the value back to where it was called. public function getFormVariable($value){ switch (strtoupper($_SERVER['REQUEST_METHOD'])) { case 'GET': if (isset($_GET[$value]) && $_GET[