Prosze znowu o pomoc. Robie wlasnie formularz logowania ktory mozna zobaczyc tutaj www.sl.scx.pl (login: user pass: user) i logowanie itd dziala ale sesja jakby znika bo wystarczy odswiezyc i znowu widac formularz logowania....
kod index.php:
<?
ob_start();//Tworzenie sesji i sprawdzanie czy user zalogowal sie <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<? require('inc/func.php'); ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Language" content="pl">
<title>Smieszne linki</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" topmargin="0">
<table border="0" cellpadding="0" cellspacing="0" width="760">
<tr>
<td width="100%" align="center">
</td>
</tr>
<tr>
<td width="100%" align="center">
<table border="0" cellpadding="0" cellspacing="0" width="719">
<tr>
<td width="350">
<table border="0" cellpadding="0" cellspacing="0" width="350">
<tr>
<td colspan="7" width="350">
<a href="index.html">
<img id="img_03" src="images/img_03.gif" width="104" height="46" alt="" border="0" /><img id="img_04" src="images/img_04.gif" width="101" height="46" alt="" border="0" /></a></td>
</tr>
<tr>
<td width="350" colspan="7"> </td>
</tr>
<tr>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<a href="wyslij_link.html"><img border="0" src="images/img_08.gif" width="77" height="20" alt="" /></a></td>
<td>
</td>
<td>
<a href="top50.html"><img border="0" src="images/img_10.gif" width="77" height="20" alt="" /></a></td>
<td>
</td>
<td>
<a href="statystyki.html"><img border="0" src="images/img_12.gif" width="77" height="20" alt="" /></a></td>
<td>
</td>
<td>
<a href="kontakt.html">
<img id="img_14" src="images/img_14.gif" width="77" height="20" border="0" /></a></td>
</tr> </tr>
</table>
</td>
<td valign="top" width="369">
<? include "inc/login_form.php" ?>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="390">
<tr>
<td width="394" height="390" valign="top" align="left">
<?
if($co=="reklama") { include "inc/reklama.php"; }
elseif($co=="kontakt") { include "inc/kontakt.php"; }
elseif($co=="statystyki") { include "inc/statystyki.php"; }
elseif($co=="top") { include "inc/top.php"; }
elseif($co=="wyslij") { include "inc/wyslij.php"; }
elseif($co=="wspolpraca") { include "inc/wspolpraca.php"; }
elseif($co=="linki_kat") { include "inc/linki_kat.php"; }
else { include "inc/linki.php"; }
?>
</td>
<td width="353" height="390" valign="top" align="center">
<? include('inc/news.php'); ?>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<a href="wspolpraca.html">
<img border="0" src="images/wspolpraca.gif" width="77" height="20" alt="" /></a></td>
<td>
</td>
<td>
<a href="reklama.html">
<img border="0" src="images/reklama.gif" width="77" height="20" alt="" /></a></td>
<td>
</td>
<td>
<a href="redakcja.html">
<img border="0" src="images/redakcja.gif" width="77" height="20" alt="" /></a></td>
<td>
</td>
<td>
<a href="kontakt.html">
<img src="images/kontakt_2.gif" width="77" height="20" border="0" /></a></td>
</tr>
</table>
</td>
</tr>
</table>
<table width="640" height="20" border="0" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
<table width="640" height="30" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<img src="images/stopka_01.gif" width="6" height="30" alt=""></td>
<td width="628" background="images/stopka_tlo.gif" align="center">
<font face="Tahoma" size="1"><font color="#D5F0FB">Copyright 2003-2005 <b>śmieszne linki</b>. All rights reserved.
Project: </font> <a href="http://www.scx.pl"><font color="#D5F0FB">Scx.pl</font></a></font></td>
<td>
<img src="images/stopka_03.gif" width="6" height="30" alt=""></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
plik z formularzem
<?
lacz();
?>
<table border="0" cellpadding="0" cellspacing="0" height="61">
<tr>
<td width="172" rowspan="3" height="61">
</td>
<td height="29">
<a href="index.html"><img src="images/home.gif" width="63" height="29" alt="" border="0"></a></td>
<td height="29">
<img src="images/archiwum.gif" alt="" width="81" height="29"></td>
<td height="29">
<a href="kontakt.html"><img src="images/kontakt.gif" width="71" height="29" alt="" border="0"></td>
</tr>
<!-- formularz logowania -->
<?
if(isset($HTTP_POST_VARS['login']) && isset($HTTP_POST_VARS['pass'])) {
// Skrypt sprawdzajacy prawdziwosc danych podczas logowania
$user = $HTTP_POST_VARS['login'];
$pass = $HTTP_POST_VARS['pass'];
$zapytanie = 'select * from users '
."where name='$user' "
." and pass='$pass'";
{
// Jezeli dane sa prawdziwe nastepuje zarejestrowanie identyfikatora usera
$HTTP_SESSION_VARS['prawid_uzyt'] = $user;
<td colspan="3" align="center" height="32">
Zalogowany jako: <b>'.$user.'</b>.
</td>
</tr>
</table>';
} else {
<td colspan="3" align="center" height="32">
<b>Nieprawidłowe dane.</b>
</td>
</tr>
</table>';
}
} elseif(isset($HTTP_SESSION_VARS['prawid_uzyt'])) {
menu_user();
}
?>
<?
// Tworzenie linkow dla zalogowanego usera
function menu_user() {
{
<td colspan="3" align="center" height="32">
Zalogowany jako: <b>'.$user.'</b>.
</td>
</tr>
</table>';
} else {
echo'<td colspan="3" align="center" height="32"> <form action="index.html" method="post">
<input type="text" name="login" size="10" class="t1">
<input type="password" name="pass" size="10" class="t1"></td>
</tr>
<tr>
<td colspan="3" align="center">
<input type="image" src="images/zaloguj.gif"></form> <a href="rejestracja.html"><img src="images/zarejestruj.gif" alt="" width="67" height="16" border="0"></a></td>
</tr>
</table>';
}
}
?>
Czy ktos wie w czym tkwi blad? Prosze o pomoc (IMG:
http://forum.php.pl/style_emoticons/default/winksmiley.jpg)