Gracias
Código:
<?php require_once('conex.php'); $user = (base64_decode($_SERVER[PHP_AUTH_USER])); $pass = (base64_decode(sha1($_SERVER[PHP_AUTH_PW]))); $query ="SELECT * FROM access WHERE user='$user' AND pass='$pass'"; $result = mysql_query($query); $validate = mysql_num_rows($result); if($validate !=1) { header('WWW-Authenticate: Basic realm="Acceso"'); header('HTTP/1.0 401 No esta Autorizado'); echo "Please leave the site"; exit; } ?> <html> <head> <title>Hola</title> </head> <body> <h2>BIENVENIDO</h2> </body> </html>