Forum Moderators: coopster

Message Too Old, No Replies

Odd PHP function needed

         

Crump

3:34 pm on Jun 26, 2006 (gmt 0)

10+ Year Member



Hi everyone:
I have an unusual function that I need to perform in PHP. I am not even sure it is possible, but I think it is.

I am trying to fetch data off of a password protected website. The user will enter his/her username and password on my site, and then PHP will enter it on the remote site, performing a "virtual login".

Now, after it is logged in the remote script generates a session key in the URL. As long as I can extract the key in MY script, then I can have access to the data I need.

This is all legit, I am not stealing info (remember the user is providing his/her password to the REMOTE site).

Any idea how I could design a function that simply logs in and returns the session key?

Someone point my in the right direction!

Thanks!

mikesmith76

5:08 pm on Jun 26, 2006 (gmt 0)

10+ Year Member



maybe could use fsockopen to "POST" the username / password to the login script of the remote website and process the output. This may not work tho if the remote login script has protection against this sort of thing, would take a bit of trial and error to find that out.

I would guess after processing the login the remote site would redirect the user to the member pages with the session id. You would have to process the output of fsockopen (which would probably be the redirect) to try and get the session id.

Hope this helps

eeek

5:15 pm on Jun 26, 2006 (gmt 0)

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



You want curl:

[php.net...]