Example #1
0
if (!$server) {
    $server = new server($_REQUEST['server_id']);
}
$current_user = new user($LOGIN_DATA['user_id'], $server);
$cities = preg_split('/[\\s\\+]+/', $_REQUEST['attack_id']);
if ($cities[0]) {
    $tocity = new city($cities[0], $server);
}
if ($cities[1]) {
    $fromcity = new city($cities[1], $server);
}
if ($fromcity && $fromcity->getValue('user')->getValue('userid') != $LOGIN_DATA['user_id']) {
    die('Invalid from city.');
}
if ($_POST['attack_id']) {
    $message = $fromcity->initiate_transaction(intval($_POST['attack_id']), intval($_POST['attack_count']), intval($_POST['attack_destination']));
    if (!$message) {
        header('Location: ' . dirname(dirname($_SERVER['SCRIPT_URI'])), true, 303);
        exit;
    }
}
//end if POST attack_id
?>
	<head>
		<title>The Project - Attack/Move</title>
		<?php 
$xhtmlSite->metaType();
?>
		<link rel="stylesheet" href="/styles/main.css" type="text/css" media="screen" />
	</head>