Witam, mam taki skrypt:
<?php
if (isset($_SESSION['user_id']) and
isset($_SESSION['login']))
{
/**
* Plik generujacy mape na podstawie wczesniej przygotowanej tablicy.
*/
// Zalaczanie pliku z polaczeniam do bazy
include('conn.php');
// Zalaczane tablicy
include('genmapfile.php');
$login = $_SESSION['login'];
/**
* Pobiera wspolrzedne gracza o ID podanym jako parametr
*
* @author: Meares (http://mearesligitharr.blogspot.com/)
* @name: GetYXForPlayer
* @param: integer $login
* @return: array
*/
function GetYXForPlayer($login) {
return $Fetched;
}
// Zdobycie wspolrzednych gracza
$YX = GetYXForPlayer(1);
// Zmiana miejsca gracza
if(($YX['y'] + 1 == $_GET['y'] || $YX['y'] - 1 == $_GET['y'] || $YX['y'] == $_GET['y']) && ($YX['x'] + 1 == $_GET['x'] || $YX['x'] - 1 == $_GET['x'] || $YX['x'] == $_GET['x']) && $Map[$_GET['y']][$_GET['x']]['CanBeOn'] === true) {
mysql_query('UPDATE `user` SET `y`='.$_GET['y'].', `x`='.$_GET['x'].' WHERE `login`='$login''); } else {
}
}
// Zdobycie aktualnych wspolrzednych gracza
$YX = GetYXForPlayer(1);
// Generowanie
// $Key zawiera wspolrzedna Y
foreach($Map as $Key => $Value) {
// $Key2 zawiera wspolrzedna X, a $Value2 to tablica zawierajaca informacje o podlozu oraz o tym czy na dane pole mozna wejsc
foreach($Value as $Key2 => $Value2) {
$EchoString[0] = '<span style="position: relative; left: 1px; z-index: 1;"><img src="images/'.$Value2['Image'].'" alt="MapElement" style="width: 32px; height: 32px;" /></span>';
// Jesli mozna wejsc na pole
if($Value2['CanBeOn'] === true) {
// Generowanie "strzaleczek"
if($Key - 1 == $YX['y'] && $Key2 == $YX['x']) {
$EchoString[1] = '<span style="position: relative; left: 0px; z-index: 2;"><a href="index.php?y='.$Key.'&x='.$Key2.'"><img src="images/arrow_down.png" alt="Go!" style="position: absolute; right: 0px; width: 32px; height: 32px;border: 0; " /></a></span>';
} else if($Key + 1 == $YX['y'] && $Key2 == $YX['x']) {
$EchoString[1] = '<span style="position: relative; left: 0px; z-index: 2;"><a href="index.php?y='.$Key.'&x='.$Key2.'"><img src="images/arrow_up.png" alt="Go!" style="position: absolute; right: 0px; width: 32px; height: 32px; border: 0; " /></a></span>';
} else if($Key2 - 1 == $YX['x'] && $Key == $YX['y']) {
$EchoString[1] = '<span style="position: relative; left: 0px; z-index: 2;"><a href="index.php?y='.$Key.'&x='.$Key2.'"><img src="images/arrow_right.png" alt="Go!" style="position: absolute; right: 0px; width: 32px; height: 32px; border: 0; " /></a></span>';
} else if($Key2 + 1 == $YX['x'] && $Key == $YX['y']) {
$EchoString[1] = '<span style="position: relative; left: 0px; z-index: 2;"><a href="index.php?y='.$Key.'&x='.$Key2.'"><img src="images/arrow_left.png" alt="Go!" style="position: absolute; right: 0px; width: 32px; height: 32px; border: 0; " /></a></span>';
} else if($Key == $YX['y'] && $Key2 == $YX['x']) {
$EchoString[1] = '<span style="position: relative; left: 0px; z-index: 2;"><img src="images/character.png" alt="Character" style="position: absolute; right: 0px; width: 32px; height: 32px;" /></span>';
} else {
$EchoString[1] = '';
}
} else {
$EchoString[1] = '';
}
}
}
}
else
{
echo "Nie jestes zalogowany";
}
I nie działa on poprawnie. Wyskakuje:
Parse error: syntax error, unexpected T_VARIABLE in /home/sites/e/en/end/endoria.za.pl/test/index.php on line 29
Czyli, że błąd jest w tej linijce:
Próbowałem dodawać apostrofy, itd ale to i tak nie działa... Mógłby mi ktoś pomóc? Byłbym wdzięczny (IMG:
style_emoticons/default/winksmiley.jpg) )))