Mam taki skrypt napisany przez kogoś i skrypt jest ok, ale do mojego zastosowanie nie wiem jak go dopasować:
logowanie .php
<?php include "haslo.php"; //skrypt :) $pass = $_POST[pass]; if ($pass) { if ($pass==$haslo) { $_SESSION[haslo] = $haslo; } else { } } else { echo ' <form method=post> Podaj haslo: <INPUT TYPE="PASSWORD" NAME="pass" VALUE="'.$pass.'"> <INPUT TYPE="SUBMIT" VALUE="Zaloguj"> </FORM> '; } $action = $_GET[action]; if ($action=="logout") { } ?>
haslo.php
<?php $haslo = "123456"; ?>
docelowy.php
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Language" content="pl" /> <meta http-equiv="refresh" content="14400"> <meta http-equiv="Reply-To" content="m@pl" /> <meta http-equiv="Creation-Date" content="Thu, 02 Jun 2011 06:56:53 GMT" /> <link rel="Stylesheet" type="text/css" href="style/styl.css" /> <title>Twc</title> </head> <body> <?php include "haslo.php"; if ($_SESSION[haslo]) { if (!($_SESSION[haslo] == $haslo)) { } } else { } ?> <frameset rows="19.8%,*" frameborder="0" framespacing="0"> <frame name="Naglowek" noresize="noresize" scrolling="no" marginwidth="8" marginheight="0" frameborder="0" src="naglowek.php" /> <frame name="Parametry" noresize="noresize" scrolling="auto" marginwidth="8" marginheight="0" frameborder="0" src="parametry.php" /> <noframes><body><a href="parametry.php">Niestety, ale Twoja przeglądarka nie obsługuje ramek.</a></body></noframes> </frameset> </body> </html>
I teraz tak: wszystko działa i po zalogowaniu przenosi mnie strone docelowy.php, ale nic nie wyświetla, prócz ustawionego koloru tła w css.
Na poczatku kazdego z plikow naglowek.php i parametry.php dodałem kilka linijek kodu (wg zaleceń autora):
<?php //pliki include "haslo.php"; if ($_SESSION[haslo]) { if (!($_SESSION[haslo] == $haslo)) { } } else { } //odtąd wstawiasz treść strony. ?>
Z góry dziękuje za podpowiedzi
Pozdrawiam
Ufff.... mam już błąd .

nie załączyłem w poniższym skrypcie plików parametry.php i naglowek.php
<?php //pliki include "haslo.php"; [b]include "parametry.php"; include "naglowek.php";[/b] if ($_SESSION[haslo]) { if (!($_SESSION[haslo] == $haslo)) { } } else { } //odtąd wstawiasz treść strony. ?>