Page 1 of 1

Grabing a file from a remote source (auth required)

Posted: Tue May 08, 2007 4:30 am
by avataru
Hello everyone,

I'm trying to create an iGoogle gadget which will grab an XML file and output something besed on its contents. The problem I'm having is that in order to get the XML file, authentication is required.

The url is something like this:
https://www.website.com/login.php?user= ... ?id=123456

When you go to that url with a browser the server will authenticate you and redirect you to https://www.website.com/xmlgenerator.php?id=123456 which outputs the XML file I need.

Any idea if it's possible to do this using PHP?

Thank you in advance.

Posted: Tue May 08, 2007 6:54 am
by hawleyjr
Use cURL to log in and to grab the necessary XML File....Search here there are some good examples :)

Posted: Tue May 08, 2007 7:03 am
by CoderGoblin
CURL could potentially be used.

Do you have an agreement with the site's ownsers to allow you to pull down the information ?

Posted: Tue May 08, 2007 7:38 am
by avataru
Yes, I am allowed to grab the file.

Just after I finished posting I found out about cURL / libcurl but they both require me to install it on the server, and I can't do that. Is there any pure-php solution?