php new bie Posted May 19, 2009 Share Posted May 19, 2009 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 ! Quote Link to comment https://forums.phpfreaks.com/topic/158679-remote-session-start-end/ Share on other sites More sharing options...
MadTechie Posted May 19, 2009 Share Posted May 19, 2009 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! Quote Link to comment https://forums.phpfreaks.com/topic/158679-remote-session-start-end/#findComment-836887 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.