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 Link to comment https://forums.phpfreaks.com/topic/81062-solved-php-username-and-password-connect/ 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? Link to comment https://forums.phpfreaks.com/topic/81062-solved-php-username-and-password-connect/#findComment-411275 Share on other sites More sharing options...
trq Posted December 10, 2007 Share Posted December 10, 2007 curl. Link to comment https://forums.phpfreaks.com/topic/81062-solved-php-username-and-password-connect/#findComment-411276 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? Link to comment https://forums.phpfreaks.com/topic/81062-solved-php-username-and-password-connect/#findComment-411285 Share on other sites More sharing options...
tommyboy123x Posted December 10, 2007 Author Share Posted December 10, 2007 cURL does this? Link to comment https://forums.phpfreaks.com/topic/81062-solved-php-username-and-password-connect/#findComment-411326 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:[email protected]" to connect authenticated sessions Link to comment https://forums.phpfreaks.com/topic/81062-solved-php-username-and-password-connect/#findComment-411442 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.