Jump to content
php.lv forumi

login izmantojot PHP_AUTH


o2T

Recommended Posts

<?php
 if(!isset($PHP_AUTH_USER)) {
   Header("WWW-Authenticate: Basic realm=\"My Realm\"");
   Header("HTTP/1.0 401 Unauthorized");
   echo "Text to send if user hits Cancel button\n";
   exit;
 } else {
   echo "Hello $PHP_AUTH_USER.<P>";
   echo "You entered $PHP_AUTH_PW as your password.<P>";
 }
?>

Link to comment
Share on other sites

×
×
  • Create New...