i960 Posted November 23, 2003 Posted November 23, 2003 Does anyone know how to connect to a server using HTTP Digest Authentication using PHP and without using Curl? The version of Curl currently installed on the server I am on (server 39) is 7.10.5, and HTTP Digest Authentication was not added to Curl until version 7.10.6, and the latest version is 7.10.8. I'm not sure if there are any planned upgrades to the servers anytime soon, but I need to be able to do this asap. Some help would be appreciated. Thanks! Jeff Kieke Quote
TCH-Sales Posted December 5, 2003 Posted December 5, 2003 Don't know if there's a way to work around this, might have to wait it out. Maybe we can get some suggestions on some alternative scripts that would do the same thing as you need done? Quote
i960 Posted December 12, 2003 Author Posted December 12, 2003 Looks like I'll have to wait it out. I've been searching around for ways to do this without curl and I'm coming up totally empty. The only things I've found are scripts like this: http://www.xiven.com/sourcecode/digestauthentication But that is something that goes on the server I am connecting to, not the other way around. FWIW, this is the code I am using: ><? $url = "http://some.url.com"; $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERPWD, "username:password"); $result = curl_exec($ch); curl_close($ch); echo $result; ?> I've also tried using the following, but this is what requires the newer version of Curl: ><? $return = `/usr/bin/curl -u username:password http://some.url.com --digest`; echo $return; ?> I just can't seem to find anything using PHP that doesn't require Curl. The company I am trying to connect to has never had anyone use PHP to connect before. They have examples using Java, but I know nothing about Java or if it's installed on the server or anything. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.