Witam, mam problem nie działa logowanie mianowicie sam nie wiem co jest grane kombinowałem i tylko gorzej zrobiłem ... To jest fragment kodu odpowiedzialnego za logowanie w PHP
<?php
FROM users
WHERE user_login='".($_POST['login'])."'");
if($_GET["wyloguj"]=="tak"){$_SESSION["zalogowany"]=0;echo "Zostałeť wylogowany z serwisu";}
if($_SESSION["zalogowany"]!=1){
if(!empty($_POST["login"]) && !empty($_POST["haslo"])){ if(mysql_num_rows(mysql_query("select * from users where user_login = '".$_POST["login"]."' AND user_haslo = '".$_POST["haslo"]."'"))){ echo "Zalogowano poprawnie."; $online_user = $_SESSION["zalogowany"]=1;
}
else echo ("Podano złe dane!!!"); }
}
else
if (!isset($_SESSION['start'])) {
$_SESSION['start'] = $now;
}
elseif ($_SESSION['start'] < $now - 3600)
{
echo "Czas(10s) sesji minąl. <a href='login.php'>Zaloguj się ponownie</a>"; }
?>
a to fragment kodu w SMARTY
{if $online_user neq NULL}
Zostales zalogowany jako {$user_login}
{else}
<div style='padding: 11px;'>
<form action='index22.php' method=post> Login:
<input size='8' class='input' type=text name=login> <a link href=''> Zarejestruj sie
</a> <br> Haslo:
<input size='8' class='input' type=password name=haslo> <input type='hidden' name='zalogowany' value='1' class='input'> <input type='image' src='templates/img/login.jpg' value='submit' onfocus='blur()' />
{/if}
Pomoże ktoś ?!