FalcorTheDog Posted August 24, 2007 Share Posted August 24, 2007 I guess the best way to describe my problem is with an example: If I am logged in to Yahoo with my Yahoo ID, and I visit: http://baseball.fantasysports.yahoo.com with my browser, it will tell me which Fantasy Baseball leagues I am in, and allow me to click on one to enter the league page. I figured therefore, that if I were already logged in, that the following code, would display the same page (i.e. I would be able to see which leagues I am in): $remotefile=fopen('http://baseball.fantasysports.yahoo.com/','r'); while (!feof ($remotefile)) { $line = fgets($remotefile); echo($line); } Unfortunately, the resulting page asks me to sign in, and doesn't display the desired leagues. But I AM still logged in to Yahoo. If I were to try to visit: http://baseball.fantasysports.yahoo.com again in my broswer, it knows I'm still logged in and displays my leagues. Basically I am trying to get at the names of the user's league with PHP, assuming the user is already logged in. I need the exact HTML that would be seen by a user that typed this address into their browser. Is this possible? Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/66490-getting-external-data-from-a-logged-in-user/ Share on other sites More sharing options...
MadTechie Posted August 24, 2007 Share Posted August 24, 2007 the problem is YOUR pc is logged in but when use you fopen the server opens the file not your PC so the server would been to be logged in, maybe have a read of cURL Quote Link to comment https://forums.phpfreaks.com/topic/66490-getting-external-data-from-a-logged-in-user/#findComment-332927 Share on other sites More sharing options...
GingerRobot Posted August 24, 2007 Share Posted August 24, 2007 Yeah, it is a job for cURL. This does mean that you would have to get the login details from the user, which they might not be happy to do. Quote Link to comment https://forums.phpfreaks.com/topic/66490-getting-external-data-from-a-logged-in-user/#findComment-332928 Share on other sites More sharing options...
FalcorTheDog Posted August 24, 2007 Author Share Posted August 24, 2007 thanks for the quick replies. I've heard of cURL... what exactly am I looking for with it? and yes, the users would be well aware that we were getting data from their login information. Quote Link to comment https://forums.phpfreaks.com/topic/66490-getting-external-data-from-a-logged-in-user/#findComment-332929 Share on other sites More sharing options...
GingerRobot Posted August 24, 2007 Share Posted August 24, 2007 http://www.google.co.uk/search?hl=en&q=php+cURL+login+to+yahoo&meta= That should get you started. Quote Link to comment https://forums.phpfreaks.com/topic/66490-getting-external-data-from-a-logged-in-user/#findComment-333084 Share on other sites More sharing options...
FalcorTheDog Posted August 24, 2007 Author Share Posted August 24, 2007 Wow, sure had a hell of a time learning about cURL. There seem to be very few (if any) decent tutorials on the subject and none of the sample scripts for logging into yahoo seemed to work on my server. After several hours of pain and tedious work, I finally figured out how to do what I needed to do. The final solution was only 11 lines of code, but damned if it wasn't one of the most obnoxious scripts i've ever written. It was a painful, but rewarding experence to say the least. Just wanted to say thanks for pointing me in the right direction! :-) Quote Link to comment https://forums.phpfreaks.com/topic/66490-getting-external-data-from-a-logged-in-user/#findComment-333360 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.