PHP Classes

basic authentication

Recommend this page to a friend!

      PHP HTTP protocol client  >  All threads  >  basic authentication  >  (Un) Subscribe thread alerts  
Subject:basic authentication
Summary:basic authentication redirect
Messages:2
Author:Raymond Dijk
Date:2007-07-15 18:53:23
Update:2007-07-15 21:57:11
 

  1. basic authentication   Reply   Report abuse  
Picture of Raymond Dijk Raymond Dijk - 2007-07-15 18:53:23
Hello,

I have a problem with a basic authentication on a site using test_http.php.
When I try to connect to the site using the test_http.php file it connects good. I am getting back a status=200 message and I can print the responce body via the HtmlSpecialChars function. So far so good.

$error=$http->ReadReplyBody($body,1000);
if($error!="" || strlen($body)==0)
break;
echo HtmlSpecialChars($body);
//print $body;

But when I would print the responce body directly to the screen the basic authentication doesn't stay alive. It promts its login message box.

$error=$http->ReadReplyBody($body,1000);
if($error!="" || strlen($body)==0)
break;
//echo HtmlSpecialChars($body);
print $body;

Does any one know how I can achieve a connection that stays alive with the authenticaton credentials.

Kind regards,

Raymond Dijk

  2. Re: basic authentication   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-07-15 21:57:11 - In reply to message 1 from Raymond Dijk
If you want to access a site that requires authentication, you need to authenticate in all pages that require authentication.

When to use access a site with this class, the basic authentication login box does not appear anywhere. That is what regular browsers do. So, I am not sure what you are talking about.