I have been playing about with parsing remote files recently and managed to parse a file to get the latest lottery results which works great. Now I would like to parse the same page that is shown when you visit http://www.virtualworlddirect.com/g.asp?m=28917 so I can extract the name showing in the red bar. I used the normal fopen and fgets to read each line into a buffer and check for a particular set of characters using strstr but the file that is fetched by the script doesn't contain the "Andy B(TheEmpireGroup.co.uk) Welcomes You" red bar. I think this is probably due to the fact that when a user surfs the page they get a cookie downloaded and then shown a page for that cookie owner. (it's an affiliate site). As the php is on a separate site, it doesn't get the cookie and so gets shown the page without any affiliate identification. (once you have a cookie on your computer, it doesn't show the page without affiliate identification) question is, how do I use php to parse the page as the user would see it? would it require some code to get the cookie first? Andy
thanks for that, I thought it might be something to do with being curly! $ch = curl_init("http://www.virtualworlddirect.com/vwdguest/default.asp?rq=0.6251795&m=28917"); $fp = fopen("example_homepage.txt", "w"); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); fclose($fp); Code (markup): I had to change the url because the text file orginally contained a message saying " this file exists at .." Now I have done that, the text file still doesn't contain the "And B.." bit. which curly bits am I missing? Andy