Jeffery Fernandez wrote:


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:[EMAIL PROTECTED] 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.


Raditha Dissanayake.
------------------------------------------------------------------ | Card Designer Applet | Drag and Drop Upload

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to