Pozdrav,
Radim za faks web stranicu i sada trenutno isprobavam internu autentikaciju - Apache sa datotekom. Napravio sam .htaccess datoteku:
AuthType Basic
AuthName "My Protected Area"
AuthUserFile "C:\\Documents and Settings\\....\\autentikacija\\admin1\\.htpasswd"
Require valid-user i .htpasswd datoteku
htpasswd -c .htpasswd username
New password: password
Re-type new password: password
I sad dolazim do problema da kada ja napravim .htaccess file odjednom nestane ta datoteka (admin1) na localhostu u koju želim ući (kada u browseru idem na localhost te datoteke nema, a kada izbrišem .htaccess file, tada se datoteka pojavi). Tada u adress bar upišem lokaciju datoteke i traži me user i pass. Upišem username i password (kao što je to u htpasswd datoteci) i javlja grešku: This server could not verify that you are authorized to access the URL "/proba/PHP_primjeri/IWA_12/autentikacija/admin1/". You either supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.
Ili izbaci grešku: The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a cgi script .
Zanima me u čemu griješim, da li .htaccess i htpasswd možda ne smiju biti u istoj datoteci koju želim zaštiti lozinkom ili nešto deseto.Inače u tom folderu se nalazi i php file koji se zove index, a kod je: $_SERVER["PHP_AUTH_USER"]. A kada izbrišem .htaccess i htpasswd tada javlja grešku: Undefined index: PHP_AUTH_USER.
Pa ako može netko detaljnije objasniti bio bih zahvalan....