Jump to content

PHP - Access


legd1991
 Share

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.