legd1991 Posted January 6, 2010 at 08:50 PM Report Share #304533 Posted January 6, 2010 at 08:50 PM boas pessoal estou com problemas a ligar o meu site em php com a bd em access.. ja fiz algumas pesquisas e apliquei o que encontrei ao meu projecto mas estou com um problema, da-me este erro: Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\Agenda\index.php on line 18 o meu codigo é este: <?php function authenticate_user() { header('WWW-Authenticate: Basic realm="Secret Stash"'); header("HTTP/1.0 401 Unauthorized"); exit; } /* se $_SERVER['PHP_AUTH_USER'] esta vazia, o utilizador ainda nao introduziu */ if (!(isset($_SERVER['PHP_AUTH_USER']))){ authenticate_user(); } else{ $conn=odbc_connect('Login','',''); $sql="SELECT User,Pass FROM Login WHERE User='$_SERVER[php_AUTH_USER]' AND Pass='$_SERVER[php_AUTH_PW]'"; $rs=odbc_exec($conn,$sql); if($nReg ==0){ authenticate_user(); }else{ echo "Bem Vindo Ao Site!!!"; } } ?> Link to comment Share on other sites More sharing options...
legd1991 Posted January 6, 2010 at 09:19 PM Author Report Share #304535 Posted January 6, 2010 at 09:19 PM ja consegui resolver o erro... mas nao tou a consegui fazer login correctamente Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now