<?php require "connection.php"; connection(); function ShowLogin($komunikat=""){ if($_SESSION["zalogowany"] == 0) { echo "Jeśli nie jesteś zarejestrowany, <a href='index.php?site=register'>Zarejestruj sie tutaj</a>"; } else { $id_gracza = $_SESSION["zalogowany"]; { $imie=$pola["name"]; $typ=$pola["type"]; } } } ?> <html> <head> <title>Chaos Theory Online</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"> <link rel="Stylesheet" type="text/css" href="style.css" /> </head> <body> <center> <div id="top"> <div id="kolumna1"> <div id="top1"> </div> <div id="mid1"> <a href='index.php'>-Strona główna</a> </div> </div> <div id="kolumna2"> <div id="top2"> </div> <div id="mid2"> <pre><?php if($_GET[site] != '') { include(''.$_GET[site].'.htm'); } else { include('main.htm'); } ?> </div> </div> <div id="top3"> <br> <br> <br> <br> <?php if($_GET["wyloguj"]=="tak"){$_SESSION["zalogowany"]=0;echo "Zostałeś wylogowany z serwisu";} if($_SESSION["zalogowany"] == 0){ $haselko=$_POST["haslo"]; $loginn=$_POST["login"]; if(mysql_num_rows(mysql_query("select * from `char` where name = '".htmlspecialchars($_POST["login"])."' AND pass = '".htmlspecialchars(md5($_POST["haslo"]))."'"))){ { $_SESSION["zalogowany"]=$pola["ID"]; } } } } ?> </div> <div id="stopka"> <? include('Stopka.txt'); ?> </div> </div> </center> </body> </html>
Mój problem polega na tym że po zalogowaniu powinien pokazywać się tekst: "zalogowany jako $imie" Wylogowywanie itp. tymczasem po kazuje sięono po zalogowaniu ale kiedy zaloguję się i kliknę np. na Strona główna albo odświeżę stronę okienko robi się puste. Co jest nie tak?