Forum Moderators: coopster

Message Too Old, No Replies

fopen() / curl authentication problem. Help please!

         

edacsac

7:55 pm on Sep 12, 2008 (gmt 0)

10+ Year Member



I'm not sure this completely related to PHP, but it starts with a PHP script. I manage a system that retrieves data from other resources on a daily basis. Historically they have been files available from ftp locations. Over time they migrate to download locations on web sites. Now I'm confronted with retrieving data that is rendered into a .csv file on the fly from a web page.

The problem I'm having is with authentication to this site. In the past I've dealt with sending .htaccess credentials and accessing sites through a firewall, sending a login:password combo, base64 encoding and what not. No big deal. This time I'm unable to authenticate. I receive the usual http request failed! error message, with little else to go by.

So I install the curl library and setup the curl options for httpauth, auth type to any, then dump the http headers. The only clue I'm getting is a 302 server response, which basically is a redirect. Changing my login:password to something incorrect doesn't change the outcome, so I'm not communicatiing correctly.

There is also a good possibility that LDAP is involved with authenticating to this particular site, but I'm finding nothing as far as curl and LDAP working together to retrieve the contents of a web page.

I'm pretty much at a loss here and not sure how to move forward. Maybe someone has been down this road before and can offer some advice? Thanks!

Demaestro

8:37 pm on Sep 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It could be that the server is bouncing you out because it doesn't like your user agent or thinks that you are a bot.

There is a way to spoof your user agent so you can test yourself if it is the user agent that is giving you the problem. Not sure what your recourse is if that is the case.

Anyway I think Multizilla has a user agent spoofer if you want to try that.