METTRE UN CODE SUR UN SITE
Résolu
mart03
Messages postés
280
Date d'inscription
Statut
Membre
Dernière intervention
-
mart03 Messages postés 280 Date d'inscription Statut Membre Dernière intervention -
mart03 Messages postés 280 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
Je voudrais savoir comment mettre un identifiant et un mots de passe à l'entrer d'un site web avec du PHP ou autre chose...
J'utilise dreamweaver CS4 pour crée mon site si vous pouvez me trouver un code un site qui m'aiderait un tutorial
Merci
Je voudrais savoir comment mettre un identifiant et un mots de passe à l'entrer d'un site web avec du PHP ou autre chose...
J'utilise dreamweaver CS4 pour crée mon site si vous pouvez me trouver un code un site qui m'aiderait un tutorial
Merci
A voir également:
- METTRE UN CODE SUR UN SITE
- Code ascii - Guide
- Site comme coco - Accueil - Réseaux sociaux
- Site de telechargement - Accueil - Outils
- Comment déverrouiller un téléphone quand on a oublié le code - Guide
- Quel site remplace coco - Accueil - Réseaux sociaux
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';
?>