diff --git a/html/index.php b/html/index.php index 34665ff..4c655f0 100644 --- a/html/index.php +++ b/html/index.php @@ -24,13 +24,13 @@ if(isset($_GET['arena'])){ //check if arena is list $currentArena = false; foreach($arenas as $arena){ - if($arena['id'] == $GET['arena']){ - $currentArena = $GET['arena']; + if($arena['id'] == $_GET['arena']){ + $currentArena = $_GET['arena']; break; } } if(!$currentArena){ - error("Wrong parameter"); + error(404,"Wrong parameter"); die; } }else{ diff --git a/src/functions.php b/src/functions.php index 41f4d66..c3bf99c 100644 --- a/src/functions.php +++ b/src/functions.php @@ -79,4 +79,17 @@ function get_language_array(){ include (__DIR__."/../lang/".$language.".php"); return $lang; +} +function error($code,$message){ + switch($error){ + case 404: + header("HTTP/1.0 404 Not Found"); + echo 'Page Not found

'.$message.'

'; + die; + default: + + die; + break; + } + } \ No newline at end of file