コード例 #1
0
ファイル: index.php プロジェクト: TCS13/SWCPM
        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
    if (!($y >= 0 && $y < \planets::getMaxPlanetGroundCoord($pid))) {
        header("Location: " . $GLOBALS['site_name'] . "?pid=" . $pid . "&msg=6");
        exit;
    }
    //Adds/Removes/Updates the deposit and redirects with an appropriate success/error message
    \planets::addDeposit($pid, $size, $who, $mat, $x, $y);
}
?>
<script type="text/javascript">
    function setPID() {
	var planetSel = document.getElementById("planet");
	var planetID = planetSel.options[planetSel.selectedIndex].value;
	form = document.createElement('form');
	form.setAttribute('method', 'POST');
	form.setAttribute('action', 'http://dot.swc-tf.com/ted_pm/');
	myvar = document.createElement('input');