http authentication problem

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
User avatar
jwalsh
Forum Contributor
Posts: 202
Joined: Sat Jan 03, 2004 4:55 pm
Location: Cleveland, OH

http authentication problem

Post by jwalsh »

Hi,

I've got our admin panel secured using HTTP Authentication. I need to include files that are in the same protected folder, but I get...

HTTP/1.1 401 Authorization Required in /home/noumcweb/public_html/Web/Internal/test.php on line 3

How do I get past this?

Josh
User avatar
jwalsh
Forum Contributor
Posts: 202
Joined: Sat Jan 03, 2004 4:55 pm
Location: Cleveland, OH

Post by jwalsh »

I'm still stumped on this. I'm assuming I need to pass the right header to the page, but how?

Thanks again,

Josh
User avatar
shiflett
Forum Contributor
Posts: 124
Joined: Sun Feb 06, 2005 11:22 am

Re: http authentication problem

Post by shiflett »

jwalsh wrote:I've got our admin panel secured using HTTP Authentication. I need to include files that are in the same protected folder
HTTP authentication only protects resources requested with HTTP. You can include files by just specifying the path on the filesystem. See here for more information:

http://php.net/include

Hope that helps.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

What is line 3? If you're using file() or file_get_contents() and you're passing it a URL, that error message makes sense. If you're just calling include() though, that error doesn't make sense. Could you post the first few lines of your code?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply