Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Logowanie
Tobi
post
Post #1





Grupa: Zarejestrowani
Postów: 19
Pomógł: 0
Dołączył: 29.12.2003
Skąd: Lublin

Ostrzeżenie: (0%)
-----


http://terror.lajt.net/tobi/index.php?page=admin tu jest link do administracji, gdy wpisze się złe dane strona się odświeża... a chcę aby pojawiało się, że jest brak dostępu wykonałem to następująco:

plik admin.php:
[php:1:c1a3b6eff6]<?

include('config.php');

if ($cmd == 'logout') {

session_destroy();

header("Location: index.php?page=admin");



}


if (have_acces('log') == 'yes') {

echo '<b><a href=index.php?page=admin&cmd=logout>Wyloguj</a></b>';

if ($op == '') {

//include ('admin/admin.adm.php');

}
else {
include ('admin/'.$op.'.adm.php');

}
}


ob_end_flush();
?>[/php:1:c1a3b6eff6]

plik config.php

[php:1:c1a3b6eff6]<?
ob_start();
$adres = "http://terror.lajt.net/tobi/";
$nick_con = 'tobi';
$pass_con = 'pawel';

include ('main.php');

session_start();

?>[/php:1:c1a3b6eff6]

plik main.php

[php:1:c1a3b6eff6]<?

function have_acces($jak) {

global $PHP_SELF, $pass, $nick, $pass_con, $nick_con, $stage;

if ($pass === $pass_con && $nick === $nick_con) {

session_register('nick');
session_register('pass');
return 'yes';

}
else {

if ($jak == 'log') {

echo '<table class="body"><form action="index.php?page=admin" method="post" class="forumlarz"><tr><td>Nick:</td><td><input type="text" name="nick" size="8"></td></tr><tr><td>Hasło:</td><td><input type="password" name="pass" size="9"></td></tr><tr><td colspan="2"><center><input class="przycisk" type="submit" value="Zaloguj"></center></td></tr></form></table>';
}
elseif ($jak == 'bez_log') {

echo '<div class="body" align="center">Brak dostępu</div>';

}
}
}

?>[/php:1:c1a3b6eff6]

Jeszcze mam problem z wylogowaniem także jeśli jesteście chętni możecie pomóc... mam nadzieje, że ktoś pomocny się znajdzie

Pozdrawiam


--------------------
GG: 2897559 | Tlen: tobi89
Homepage by Tobi | tobi.folio | <? PHPowiec.pl ?>
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 03:14