Using PHP, how can I login to a server that uses basic http auth. There are no forms or anything so I'm not sure how to go about it. The public ones I've tried are buggy and many do not work. Can someone show me a basic working example?
Asked
Active
Viewed 103 times
0
-
You cannot log into an _ftp_ server using _http auth_. – arkascha Mar 31 '14 at 15:33
-
HTTP auth with an FTP server doesn't really make that much sense. Are you sure you really mean to use HTTP authentication? – Eugen Timm Mar 31 '14 at 15:36
-
I meant just HTTP auth, I've edited the post now – user3412816 Mar 31 '14 at 15:38
1 Answers
1
You may want to take a look at this quetsion: How do I make a request using HTTP basic authentication with PHP curl?
Using cURL:
curl_setopt($process, CURLOPT_USERPWD, $username . ":" . $password);