![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 11 Pomógł: 0 Dołączył: 1.05.2003 Ostrzeżenie: (0%) ![]() ![]() |
Witam mam skrypt autoryzacji
Kod <?
if (!isset($PHP_AUTH_USER)) { header('WWW-Authenticate: Basic realm="n3team"'); header('HTTP/1.0 401 Unauthorized'); exit; } else if (isset($PHP_AUTH_USER)) { $plik = ".htpasswd"; $fp = fopen($plik, "r"); $zawartosc = fread($fp, filesize($plik)); fclose($fp); $linia = explode("n", $zawartosc); $i = 0; while($i <= sizeof($linia)) { $dane = explode(":", $linia[$i]); if (($dane[0] == "$PHP_AUTH_USER") && ($dane[1] == "$PHP_AUTH_PW")) { $auth = 1; break; } else { $auth = 0; } $i++; } if ($auth == "1") { echo "<p>Logged in!</p>"; exit; } else { header('WWW-Authenticate: Basic realm="IG3Net Control Center"'); header('HTTP/1.0 401 Unauthorized'); echo 'Access Danied'; exit; } } ?> ale on czyta hasla user:pass a jak zrobic zeby uzywac kodowane hasla (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) |
|
|
![]() ![]() |
![]() |
Aktualny czas: 22.08.2025 - 19:24 |