Re: HTTP Authenticate via PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeffery Fernandez wrote:

Hi,

I am trying to find out if its possible to authenticate a page against an HTTP authentication. Basically what I am trying to do is make available the stats page of the Cpanel to the admin interface of a site. When accessing the stats via the cpanel the user needs to login via http authentication.

Is it possible for me to store the username password credentials within the php page and pass that across via headers to authenticate the page for viewing the stats. The main purpose is to make the webstats transparent to the admin user so they don't have to enter any username/password. I tried putting the username:password@domain into the url of an iframe page(session controlled) but stupid IE spits the authentication as a pop-up (login window). Hope I have explained well enough.

One option is to send an authorization header. (exaple: "Authorization: Basic " . credentials) more details are available in the RFC 2616 but the disadvantage is that you would not be able to make use of the fopen() method. My understanding however is that the url of the type that you described about should work. CPanel and other virtual hosting schemes have an '@' sign in the username that probably caused the hiccups you should try urlencoding the username and password.

cheers,
Jeffery



--
Raditha Dissanayake.
------------------------------------------------------------------
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/ | Drag and Drop Upload


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux