Autenticando con PHP
| Categorías PHP, Programacion, internet, telecomunicaciones | Fecha 14-10-2009 | Comentario 0
Aqui les muestro un poco de Código que he tomado de PHP.net
1 2 3 4 5 6 7 8 9 10 11 | < ?php
if (!isset($_SERVER['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';
exit;
} else {
echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.";
echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your password.</p>";
}
?> |
[ad#ad-1]
number of view: 11