Sending htpasswd login information in a url


I have a PHP script which gets CSV information from a remote destination using the file($url) command. However they have recently added htpasswd authentication to this page and I need a way to send the username and password along with the URL for the script to work.

Is this possible and if so can anyone tell me how to do it?


you can use this to send username password in url

Thanks, that worked perfectly.

has anyone else noticed that IE sees this format as invalid. Seems to work fine for me in firefox, but not IE

It worked fine for me. I dont think IE has any problem with it.