|
-
May 19th, 2003, 05:28 PM
#1
Thread Starter
Addicted Member
cURL to pass htaccess authentication? [RESOLVED]
Do you know how to use CURL, Client URL Library Functions to get a page that is protected with htaccess if you know the username and password for the realm?
I tried this
Code:
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_USERPWD, "[username]:[password]");
//curl_setopt ($ch, CURLOPT_HEADER, 0); with and without this line
curl_exec ($ch);
curl_close ($ch);
but it says I didn't authenticate.
I've used it in the past to get an unprotected url and even to pass info via post.
Or is there a way to pass it in the url like we would for ftp?
Last edited by Phenix; May 20th, 2003 at 10:18 AM.
-
May 19th, 2003, 05:45 PM
#2
Frenzied Member
passing it in the url should work. other than that I have not used curl to pass info like that
-
May 19th, 2003, 07:11 PM
#3
Thread Starter
Addicted Member
I'll have to test it tomorrow at work.
-
May 20th, 2003, 10:15 AM
#4
Thread Starter
Addicted Member
Saahhweeet
as the url, works directly without having to add any additional CURLOPT_'s.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|