Forum Moderators: coopster

Message Too Old, No Replies

Making a PHP script that can login and browse other websites

Maintaining a session with other sites using your PHP script

         

ryan_b83

6:17 pm on Aug 17, 2007 (gmt 0)

10+ Year Member



Hello, I am trying to figure out a way to have my PHP script login to another website, browse pages and possibly fill out a form. So i guess my PHP script needs to be able to maintain a session ID with another website. Any ideas?

Thanks,
Ryan

RogueDogg

8:17 pm on Aug 17, 2007 (gmt 0)

10+ Year Member



Sounds like a security risk to me, but I'm not the expert here. Just figured i'd put my 2cents worth in. ;-)

Habtom

5:26 am on Aug 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So i guess my PHP script needs to be able to maintain a session ID with another website.

Having a central db could be a solution where you store your session, and can then be used by the other site. Can sessions be shared across domains? I don't think so.

Habtom

SteveLetwin

7:09 am on Aug 19, 2007 (gmt 0)

10+ Year Member



You could try curl. There is a PHP interface to it, and it will allow you to set cookies and simulate filling out a form by setting form fields and using POST.

ryan_b83

1:28 pm on Aug 21, 2007 (gmt 0)

10+ Year Member



Sorry maybe i didnt explain myself correctly. The site i am trying to log into is not one of my sites. For example, eBay (i dont own this site of course...lol) but how would I make one of my scripts go to the login page, login (using the username/password provided), go to a page and submit a form.

Is something like this possible?

Thanks,
Ryan

jatar_k

1:31 pm on Aug 21, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



yes, using cURL

[php.net...]
[curl.haxx.se...]