botsArena/src/arenas/connectFour/functions.php

18 lines
398 B
PHP
Raw Normal View History

2016-05-09 23:38:36 +02:00
<?php
2016-05-10 17:05:09 +02:00
2016-05-09 23:38:36 +02:00
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']);
}