HTTP Auth problem

N

Neil Hitchmough

I want to access a page on a remote webserver that is protected by
HTTP authenticate (username and password box) that appears when you go
to the page.

I know that you can do this (using PHP or CGI) but I'm not sure how to
do this in asp.

An example of a page that does do this (just to prove I'm not talking
rubbish) is: http://web-sniffer.net/index.php which does exactly what
I'm on about.

I know how to do this in PHP using:

if ($PHP_AUTH_USER != "user"
or $PHP_AUTH_PW != "pass"):
// Bad or no username/password.
// Send HTTP 401 error to make the
// browser prompt the user.
header("WWW-Authenticate: " .
"Basic realm=\"Protected Page: " .
"Enter your username and password " .
"for access.\"");
header("HTTP/1.0 401 Unauthorized");

But how do I do this in Classic ASP? I'm assuming that i've got to set
the headers when I go to get the page but how?

Regards

Neil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top