error function
This commit is contained in:
parent
66e7650ae6
commit
1f457dd4c4
|
@ -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{
|
||||
|
|
|
@ -80,3 +80,16 @@ 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 '<!DOCTYPE html><html lang="fr"><head><meta charset="UTF-8" /><title>Page Not found</title></head><body><p>'.$message.'</p></body></html>';
|
||||
die;
|
||||
default:
|
||||
|
||||
die;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user