Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> zabezpieczenei strony hasłem , help!
unnamed
post
Post #1





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 25.09.2006

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


mam skrypt, który chroni stronę www hasłem (to ten poniższy) i pytanie: gdzie go mam wstawić aby to działało?


  1. <?php
  2. if(!($PHP_AUTH_USER)):
  3.  Header("WWW-authenticate: basic realm=Restricted Area");
  4.  Header("HTTP/1.0 401 Unauthorized");
  5.  echo "";
  6.  exit;
  7. else:
  8. if (($PHP_AUTH_USER)!=("login")): 
  9. echo "<meta http-equiv="refresh"content="0; url=blad.html">"; 
  10. exit; 
  11. endif;
  12. if (($PHP_AUTH_PW)!=("password")): 
  13. echo "<meta http-equiv="refresh"content="0; url=blad.html">"; 
  14. exit; 
  15. endif;
  16. endif;
  17. ?>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
SongoQ
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 2 923
Pomógł: 9
Dołączył: 25.10.2004
Skąd: Rzeszów - studia / Warszawa - praca

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


Najlepiej do index.php


--------------------
Go to the top of the page
+Quote Post

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: 19.08.2025 - 18:37