Jump to content

Remote session start & end !


php new bie

Recommended Posts

hi,

It may be a noob Q, but I'll appreciate any help :-)

 

www.example.com is a remote host that uses ASP applications and java scripts and window's frames.

 

So I need to get some data from these systems using

 

file_get_contents function but the site depends on session .

 

Any way to make a connection to the remote host and retrieve the generated session and use it through my code, then close the connection when the page completely loaded and if reloaded .. the cycle repeated by getting the new session and so on !

Link to comment
Share on other sites

your need to use cURL, with cookies, try this untested function

 

function cUrl_get_contents($url)
{
$ch = curl_init($url);
curl_setopt ($ch, CURLOPT_COOKIEJAR, "cookie.txt");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
return curl_exec ($ch);
}

 

PS i am having a bad phping day so this will probably fail!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.