METTRE UN CODE SUR UN SITE
Résolu/Fermé
mart03
Messages postés
279
Date d'inscription
vendredi 16 mai 2008
Statut
Membre
Dernière intervention
5 juin 2012
-
12 févr. 2009 à 21:58
mart03 Messages postés 279 Date d'inscription vendredi 16 mai 2008 Statut Membre Dernière intervention 5 juin 2012 - 12 févr. 2009 à 22:57
mart03 Messages postés 279 Date d'inscription vendredi 16 mai 2008 Statut Membre Dernière intervention 5 juin 2012 - 12 févr. 2009 à 22:57
A voir également:
- METTRE UN CODE SUR UN SITE
- Site de telechargement - Guide
- Site inaccessible - Guide
- Site de vente entre particulier - Guide
- Code asci - Guide
- Comment créer un qr code - Guide
2 réponses
code a mettre en debut de la page php a proteger
<?php
include "protection_pages.php";
?>
mettre dans le mm dossier un fichier php intitulé protection_pages.php avec comme code
<?php
if ( !isset($_SERVER['PHP_AUTH_USER'])
|| !isset($_SERVER['PHP_AUTH_PW'])
|| ($_SERVER['PHP_AUTH_USER'] !== " LOGIN A REMPLIR" )
|| ($_SERVER['PHP_AUTH_PW'] !== " MOT DE PASSE A REMPLIR") )
{
header('WWW-Authenticate: Basic realm="Authentifiez vous"');
header('HTTP/1.0 401 Unauthorized');
echo 'Acces non autorise';
exit;
}
echo 'Utilisateur authentifie';
?>
<?php
include "protection_pages.php";
?>
mettre dans le mm dossier un fichier php intitulé protection_pages.php avec comme code
<?php
if ( !isset($_SERVER['PHP_AUTH_USER'])
|| !isset($_SERVER['PHP_AUTH_PW'])
|| ($_SERVER['PHP_AUTH_USER'] !== " LOGIN A REMPLIR" )
|| ($_SERVER['PHP_AUTH_PW'] !== " MOT DE PASSE A REMPLIR") )
{
header('WWW-Authenticate: Basic realm="Authentifiez vous"');
header('HTTP/1.0 401 Unauthorized');
echo 'Acces non autorise';
exit;
}
echo 'Utilisateur authentifie';
?>
mart03
Messages postés
279
Date d'inscription
vendredi 16 mai 2008
Statut
Membre
Dernière intervention
5 juin 2012
21
12 févr. 2009 à 22:57
12 févr. 2009 à 22:57
merci je vais essayer !!