$mat = \planets::getParam('mat'); $size = \planets::getParam('size'); $x = \planets::getParam('surfX'); $y = \planets::getParam('surfY'); //Verifies no blank parameters if ($who == '' || $mat == '' || $size == '' || $x == '' || $y == '') { header("Location: " . $GLOBALS['site_name'] . "?pid=" . $pid . "&msg=1"); exit; } //Verifies planet exists if (!\planets::planetExists($pid)) { header("Location: " . $GLOBALS['site_name'] . "?msg=2"); exit; } //Verifies RM exists if (!\planets::matExists($mat)) { header("Location: " . $GLOBALS['site_name'] . "?pid=" . $pid . "&msg=3"); exit; } //Removes formatting from numbers, verifies size is >= 0 and numeric $size = str_replace(",", '', $size); if ($size < 0 || !is_numeric($size)) { header("Location: " . $GLOBALS['site_name'] . "?pid=" . $pid . "&msg=4"); exit; } //Verifies x-coordinate is valid given the current planet if (!($x >= 0 && $x < \planets::getMaxPlanetGroundCoord($pid))) { header("Location: " . $GLOBALS['site_name'] . "?pid=" . $pid . "&msg=5"); exit; } //Verifies y-coordinate is valid given the current planet