Hi,
as propably many other, i am new to php... today :-)
i have a webpage which i want to access with username and password. everything is in php. i found some nice php scripts which can be easily implemented. here is some php authentication and redirect script.
<?php
// sample #1 redirect after success
if ( ( !isset( $PHP_AUTH_USER )) || (!isset($PHP_AUTH_PW))
|| ( $PHP_AUTH_USER != 'user' ) || ( $PHP_AUTH_PW != 'open' ) ) {
header( 'WWW-Authenticate: Basic realm="Private"' );
header( 'HTTP/1.0 401 Unauthorized' );
echo 'Authorization Required.';
exit;
} else {
header( 'Location: [url]http://www.php.net/index.php[/url]' );
}
?>
<?php
My authentication window popup but when i enter username and password, it doesn't let me to login and still popup again. I think i have a problem with php variables. HOW? Can i set up PHP variables for PHP_AUTH_USER and PHP_AUTH_PW? I appreciate any help.
Thanks a lot
PHP Newbie