» »

User authentication + PHP + IIS

User authentication + PHP + IIS

kuntek ::

Zakaj ne morem delat z user authentication v PHPju na IIS??? Nonstop mi javlja neke errorje. PHP na IIS poganjam kot module (z php4isapi.dll) in ne kot CGI. Za začetek sem probal tole kodo: if (!isset($_SERVER['PHP_AUTH_USER'])) {
header("WWW-Authenticate: Basic realm="My Realm"");
header("HTTP/1.0 401 Unauthorized");
echo "Text to send if user hits Cancel buttonn";
exit;
} else {
echo "

Hello {$_SERVER['PHP_AUTH_USER']}.

";
echo "

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

";
}
?>
Koda je direktno iz manuala!

  • spremenil: kuntek ()

Gandalfar ::

daj poskusi napisat tiste 'neke errorje'.

kuntek ::

Warning: Cannot add header information - headers already sent by (output started at c:\inetpub\wwwroot\test.php:6) in c:\inetpub\wwwroot\test.php on line 8

Warning: Cannot add header information - headers already sent by (output started at c:\inetpub\wwwroot\test.php:6) in c:\inetpub\wwwroot\test.php on line 9

darh ::

pred funkcijo header(); NE sme biti nikakršnega outputa.. tud nove vrstice ne... nič...

Seveda, če bi si prebral v manualu kaj, bi to vedu...

Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists when using a single PHP/HTML file.
Excuses are useless! Results are priceless!


Vredno ogleda ...

TemaSporočilaOglediZadnje sporočilo
TemaSporočilaOglediZadnje sporočilo
»

iis 7 in dll datoteke

Oddelek: Izdelava spletišč
7657 (591) Neon87
»

phpBB forum; a dela na IIS?

Oddelek: Programska oprema
221986 (1715) boych
»

IIS in Apache na enem računalniku

Oddelek: Izdelava spletišč
51269 (1193) webfreak
»

Katera web galerija (že narejena ali tista za IIS)

Oddelek: Izdelava spletišč
61222 (1141) andrej
»

PHP problem

Oddelek: Izdelava spletišč
5869 (756) Matri[X]

Več podobnih tem