Parse error: syntax error, unexpected T_ELSE in /membri/enkantar2/www/login_.php on line 100
Mi dā questo errore! Ma che cosa sbaglio?
Codice PHP:
<?php include "antet.php"; include "func.php";
if (isset($_POST["name"], $_POST["pass"]))
{
$_POST["name"]=clean($_POST["name"]); $_POST["pass"]=clean($_POST["pass"]);
$_SESSION["user"]=login($_POST["name"], md5($_POST["pass"]));
$config=config();
if ((!$config[2][1])&&($_SESSION["user"][4]<4))
{
$_SESSION = array();
session_destroy();
msg($lang['loginClosed']);
}
else if ($_SESSION["user"][0])
{
if (check_d($_SESSION["user"][0]))
{
$query = "SELECT id, email FROM users WHERE name == ".$_SESSION["user"]."";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$query2 = "SELECT * FROM towns WHERE owner == ".$row[id]."";
$result2 = mysql_query($query2);
$citta = mysql_num_rows($result2);
if ($citta != "0")
{
if (isset($_SESSION["user"][0]))
{
$land=get_land();
$xy=$land[rand(0, count($land)-1)];
$towns=towns($_SESSION["user"][0]);
if (count($towns))
{
$is_cap=0; $data=explode("-", $towns[0][8]); $army=explode("-", $towns[0][7]);
if ($data[7]<10) msg($lang['needCastle']);
if ($army[11]<10) msg($lang['needColonists']);
}
else $is_cap=1;
}
else {header('Location: login.php'); die();}
?>
<html>
<?php echo "<link rel='stylesheet' type='text/css' href='".$imgs.$fimgs."default.css'>"; ?>
<script src="func.js" type="text/javascript"></script>
<head>
<title><?php echo $title; ?> - <?php echo $lang['createTown'] ?></title>
</head>
<body class="q_body">
<div align="center">
<?php echo $top_ad; ?>
<table class="q_table">
<tr>
<td class="td_logo">
<?php logo($title); ?></td>
</tr>
<tr>
<td class="td_top_menu"><?php menu_up(); ?></td>
</tr>
<tr>
<td class="td_content"><form name="form1" method="post" action="create_.php?is_cap=<?php echo $is_cap; ?>">
<center><b>Non hai ancora fondato nessuna citta, fallo adesso!</b>
</br><img height='95' src='construction.gif'></br></center>
<p><?php echo $lang['desCoord'] ?>:
<input class="textbox" name="x" id="x" type="text" size="5" value="<?php echo $xy[0]; ?>">
<input class="textbox" name="y" id="y" type="text" size="5" value="<?php echo $xy[1]; ?>">
[<a class='q_link' href="javascript: go('create.php');"><?php echo $lang['random'] ?></a>]
</p>
<p><?php echo "Nome della cittā:"?>
<input class="textbox" name="name" type="text" size="25" value="villaggio di <?php echo $_SESSION["user"][1]; ?>">
</p>
<p>
<input class="button" type="submit" name="go" value="<?php echo $lang['create'] ?>">
</p>
</form>
</td>
</tr>
<tr>
<td class="td_bottom_menu">
<?php menu_down(); ?></td>
</tr>
</table>
<?php echo $bottom_ad; ?>
<p><?php about(); ?></div>
</body>
</html>
<?php
}
else
{
$query3 = "SELECT id FROM towns WHERE owner == ".$row[id]."" AND isCapital == 1;
$result3 = mysql_query($query3);
$capitale = mysql_fetch_array($result3);
header('Location: towns.php?town=".$capitale."');
}
else header('Location: logout.php');
}
else msg($lang['noUserWrong']);
}
else msg($lang['noInput']);
?>