mynamesleo Posted December 4, 2006 Share Posted December 4, 2006 If i go to youtube.com, as I am logged in I am greeted with "Hello, username!" otherwise "hello, guest"When I do file_get_contents("http://youtube.com") and check the html, it has treated me as a guest..So is there a way to get the contents with the cookie information there?Reason is I would like to greet people at my site with their youtube username as does youtube, if they have been logged in.. So the plan was to get the contents of youtube.com, then grab the username out of the html code.. and greet them at my website "Hello, username" else, hello guest.. (Hope this is understandable!)Thanks! Link to comment https://forums.phpfreaks.com/topic/29450-a-question/ Share on other sites More sharing options...
fert Posted December 4, 2006 Share Posted December 4, 2006 You can't because file functions don't send cookies when getting a file. Link to comment https://forums.phpfreaks.com/topic/29450-a-question/#findComment-135150 Share on other sites More sharing options...
trq Posted December 5, 2006 Share Posted December 5, 2006 You could login and retrieve your response using [url=http://php.net/curl]curl[/url]. Link to comment https://forums.phpfreaks.com/topic/29450-a-question/#findComment-135201 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.