battle ship functions

pull/18/head
gnieark 9 years ago
parent 2c033e19cd
commit bed6efdf44

@ -0,0 +1,17 @@
<?php
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']);
}
Loading…
Cancel
Save