• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 250
  • Last Modified:

save session (cookies)

I want to code 1 page which can do
 + Login into a website with my account.
 + Get data from this site which was login.

Ex, I want this page can  :
  + login into a forum, then get post data of this forum.

How can I do that ?
please help me
0
ngocquynh85
Asked:
ngocquynh85
1 Solution
 
German_RummCommented:
Hi ngocquynh85,

Basically, you will need to use fsockopen() (www.php.net/fsockopen) to open connection.
Then you will need to create POST request with your login name and password.
Then you send this request to website and capture output, watching for Set-Cookie: headers.
You collect all those cookies and create another request, in which you include those cookies.
And then capture output again and hope it's not gzipped :-)

It's probably a lot of work, I recommend you not to write it yourself but try PEAR HTTP Packages:
http://pear.php.net/packages.php?catpid=11&catname=HTTP

---
German Rumm.
0
 
ngocquynh85Author Commented:
please tell me more detail ??? or example.
0
 
hujiCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:
Accept: German_Rumm

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Huji
EE Cleanup Volunteer
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now