You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
730 B
PHP
29 lines
730 B
PHP
<?php
|
|
#- BEGIN LICENSE BLOCK ---------------------------------------
|
|
#
|
|
# This file is part of botsArena.
|
|
#
|
|
# Copyright (C) Gnieark et contributeurs
|
|
# Licensed under the GPL version 3.0 license.
|
|
# See LICENSE file or
|
|
# http://www.gnu.org/licenses/gpl-3.0-standalone.html
|
|
#
|
|
# -- END LICENSE BLOCK -----------------------------------------
|
|
|
|
function get_Post_Params($botsCount){
|
|
$keysBots=array('bot1','bot2');
|
|
foreach($keysBots as $botKey){
|
|
if(!isset($_POST[$botKey])){
|
|
return false;
|
|
}
|
|
if(!is_numeric(($_POST[$botKey]))){
|
|
|
|
}
|
|
if(($_POST[$botKey] < 0) OR ($_POST[$botKey] > $botsCount)){
|
|
error(400,"wrong parameters");
|
|
die;
|
|
}
|
|
}
|
|
return array('bot1' => $_POST['bot1'],'bot2' => $_POST['bot2']);
|
|
}
|