Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2713 connectés 

  FORUM HardWare.fr
  Programmation

  [php] authentification

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[php] authentification

n°88032
otb82
Fear is Failure
Posté le 10-01-2002 à 21:30:17  profilanswer
 

je desirerais mettre une partie privée a mon site web. Celui ci est en PHP.
Le code suivant fonctionne en local, mais sur mon compte free, il veut rien entendre ... ca me donne un putain message d'erreur qui dis de regarder mes log (mais j'en ai pas)... vous pouvez voir vous meme sur : otb1982.free.fr/index.php3?page=prive
 
<?
if ($page == prive)
{
 if ((!isset($PHP_AUTH_USER)) || (!isset($PHP_AUTH_PW)))  
 {  
     header('WWW-Authenticate: Basic realm="Identifiez-vous"';);  
     header('HTTP/1.0 401 Unauthorized';);  
     //echo 'Authorization Required.';  
            echo "<script language='JavaScript'>document.locatio
n.replace('index.php?page=fail';);</scr
ipt>";
     exit;  
 
 }  
 else  
 if ((isset($PHP_AUTH_USER)) && (isset($PHP_AUTH_PW)))
 {  
     if (($PHP_AUTH_USER != "otb82" ) || ($PHP_AUTH_PW != "yep" ))  
  {  
         header('WWW-Authenticate: Basic realm="Veuillez vous identifier :"';);  
  echo "<script language='JavaScript'>document.locatio
n.replace('index.php?page=fail';);</scr
ipt>";
         exit;  
           }  
 }  
}
?>

mood
Publicité
Posté le 10-01-2002 à 21:30:17  profilanswer
 

n°88042
Mara's dad
Yes I can !
Posté le 10-01-2002 à 21:42:55  profilanswer
 

Chez free, il faut utiliser un fichier .htaccess
http://support.free.fr/web/restriction_acces.html


---------------
Laissez l'Etat dans les toilettes où vous l'avez trouvé.
n°88060
otb82
Fear is Failure
Posté le 10-01-2002 à 22:03:12  profilanswer
 

Mara's dad a écrit a écrit :

Chez free, il faut utiliser un fichier .htaccess
http://support.free.fr/web/restriction_acces.html  




ok merci


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation

  [php] authentification

 

Sujets relatifs
[PHP] authentification et hébergeurs gratuit[PHP] Header & authentification
[DELPHI + ACCESS] authentificationauthentification NT
php, authentification au serveur 
Plus de sujets relatifs à : [php] authentification


Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)