On 11/19/2003 12:30 PM, Chandu Nannapaneni wrote:
hello all ,
I'm able to get successfully http authenticated from my php scripts
Ex : $header = "POST /myscript.php HTTP/1.0\r\nAuthorization: Basic "; $header .= base64_encode("$username:$password")."\r\n"; $header .= "Content-type: application/x-www-form-urlencoded\r\n"; ........ $fp = fsockopen($IP, $PORT, $errno, $errstr); if ($fp) { fputs($fp, $header . $request); while (!feof($fp)) { $response .= fgets($fp, 128); } }
But the above is not working when the $username contains a trailing semicolon or when the $password is starting with a semicolon, Ex: what if the $username ="chandu:"
Is there any solution for this ?
You need to encode user names properly. You may want to take a look at this class to see how it is done:
http://www.phpclasses.org/httpclient
--
Regards, Manuel Lemos
Free ready to use OOP components written in PHP http://www.phpclasses.org/
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php