sparkling_tux wrote in php

Hi everyone!
Could please somebody help me.
I need the page (on php) with authorization. I want the browser to pop-up the authorization request dialog. So I've tried to put on the page a code like:

header('WWW-Authenticate: Basic realm="Authentication and proceeding"');
header('HTTP/1.0 401 Unauthorized');
if ($_SERVER["PHP_AUTH_USER"]=="petya" and $_SERVER["PHP_AUTH_PW"]=="cool") {
echo "

Hello {$_SERVER[PHP_AUTH_USER]}

"; echo "

You entered {$_SERVER[PHP_AUTH_PW]} as your password.

"; } else { echo "You're possibly trying to cheat here!"; }


Unfortunately, to the moment after you enter ID and PW this dialog appears again, thus working some other way I want it to.