tommyboy123x Posted December 10, 2007 Share Posted December 10, 2007 should be easy -- how do you connect to a website to download a file with a username and password? just one of those mental blocks i guess thanks Quote Link to comment Share on other sites More sharing options...
revraz Posted December 10, 2007 Share Posted December 10, 2007 Not really sure what you are asking. Are you looking for just a basic user authentication tutorial? Quote Link to comment Share on other sites More sharing options...
trq Posted December 10, 2007 Share Posted December 10, 2007 curl. Quote Link to comment Share on other sites More sharing options...
tommyboy123x Posted December 10, 2007 Author Share Posted December 10, 2007 I just want to be able to download a specific file with a script but i need to authenticate myself first because the file is generated by a password protected script. how? Quote Link to comment Share on other sites More sharing options...
tommyboy123x Posted December 10, 2007 Author Share Posted December 10, 2007 cURL does this? Quote Link to comment Share on other sites More sharing options...
tommyboy123x Posted December 10, 2007 Author Share Posted December 10, 2007 $ch = curl_init(); $handle = fopen("file.txt", "w"); curl_setopt($ch, CURLOPT_URL, "$url"); curl_setopt($ch,CURLOPT_USERPWD,"user:password"); curl_setopt($ch,CURLOPT_FILE,$handle); curl_exec($ch); thanks. i looked back and found i just typed in "http://user:pass@domain.com" to connect authenticated sessions Quote Link to comment Share on other sites More sharing options...
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.