Hi
ich bekomme bei meinem script den error:
Parse error: syntax error, unexpected T_ELSE in /opt/lampp/htdocs/tescht.php on line 56
ich hab viel versucht, find dn fehler aber nicht
ich bekomme bei meinem script den error:
Parse error: syntax error, unexpected T_ELSE in /opt/lampp/htdocs/tescht.php on line 56
ich hab viel versucht, find dn fehler aber nicht
PHP-Code:
<?php
if ($_SESSION['login_status'] == 1) {
$server = $_GET["server"];
$char = $_GET["char"];
if (($server == "") AND ($char == "")) {
$login = $_SESSION['login'];
$db = mysql_connect("localhost","root","omg147rofl123") or mysql_die("Unable to connect");
mysql_select_db("browsergame",$db);
$result1 = mysql_query("SELECT `account_id` FROM `login` WHERE `userid`='$login'");
list($account_id) = mysql_fetch_row($result1);
mysql_close($db);
echo " <table border=\"0\" width=\"400\">";
echo " <tr>";
echo " <td width=\"400\">";
echo " <table border=\"0\">";
echo " <tr>";
echo " <td width=\"313\"><b>Name:</b></td>";
echo " <td width=\"313\"><b>Base Lvl:</b></td>";
echo " <td width=\"313\"><b>Job Lvl:</b></td>";
echo " </tr>";
$db = mysql_connect("localhost","root","omg147rofl123") or mysql_die("Unable to connect");
mysql_select_db("browsergame",$db);
$result2 = mysql_query("SELECT `name` FROM `char` WHERE `account_id`='$account_id'");
$result8 = mysql_query("SELECT `job_level` FROM `char` WHERE `account_id`='$account_id'");
$result9 = mysql_query("SELECT `base_level` FROM `char` WHERE `account_id`='$account_id'");
//for ($i=1; $i<12; $i++) {
for ($i=0; $i<12; $i++) {
echo " <tr>";
echo " <td width=\"313\"> ";
if (list($char_name) = mysql_fetch_row($result2))
echo $char_name;
echo " </td>";
echo " <td width=\"313\">";
if (list($char_blvl) = mysql_fetch_row($result9))
echo $char_blvl;
echo " </td>";
echo " <td width=\"313\">";
if (list($char_jlvl) = mysql_fetch_row($result8))
echo $char_jlvl;
echo " </td>";
else{
if ($i == 0) {
echo "<font color=\"#C80000\"><b>";
echo "Du hast keine Characktere auf tROpico<br>";
echo "</font></b>";
} else
echo " ";
};
echo " </td>";
echo " </tr>";
}
mysql_close($db);
echo " </table>";
echo " </td>";
echo " </tr>";
echo "</table>";
} else if (($server != "") AND ($char != "")) {
$login = $_SESSION['login'];
$db = mysql_connect("localhost","root","omg147rofl123") or mysql_die("Unable to connect");
mysql_select_db("browsergame",$db);
$result1 = mysql_query("SELECT `account_id` FROM `login` WHERE `userid`='$login'");
list($account_id) = mysql_fetch_row($result1);
mysql_close($db);
if ($server == "tROpico") {
$db = mysql_connect("localhost","root","omg147rofl123") or mysql_die("Unable to connect");
mysql_select_db("browsergame",$db);
}
if ($server == "Chaos") {
$db = mysql_connect("localhost","root","omg147rofl123") or mysql_die("Unable to connect");
mysql_select_db("browsergame",$db);
}
mysql_query("UPDATE `char` SET `last_map`='prontera', `last_x`='156', `last_y`='189', `save_map`='prontera', `save_x`='156', `save_y`='189' WHERE `name`='$char' AND `account_id`='$account_id'");
mysql_close($db);
echo "Dein Charackter ".$char." auf ".$server." wurde erfolgreich nach Prontera versetzt.<br><br>";
};
};
?>
Kommentar