AndyBG Posted December 31, 2007 Share Posted December 31, 2007 In a browser, I can enter a URL and the remote server decides which HTML or PHP page to send back to my browser which is displayed nicely on my screen. How do I get my PHP app to do a similar thing? I want to be able to enter (say) www.blah.com and for the same page to come back to my PC so it can be stored on my disk as an HTML file. Obviously, browsers know how to do this, and programs such as WinHTTrack make a fair job of it, but can it be done using PHP? Thanks for looking. Quote Link to comment https://forums.phpfreaks.com/topic/83864-solved-how-do-i-get-php-to-get-web-page-from-another-site/ Share on other sites More sharing options...
revraz Posted December 31, 2007 Share Posted December 31, 2007 PHP will send back all results as HTML. So you never see the actual PHP code. Is that what you mean? Quote Link to comment https://forums.phpfreaks.com/topic/83864-solved-how-do-i-get-php-to-get-web-page-from-another-site/#findComment-426793 Share on other sites More sharing options...
AndyBG Posted December 31, 2007 Author Share Posted December 31, 2007 Not really. Say I wanted to browse using IE whatever, to www.blah.com. The server will load what it thinks is the home page (say index.php), it gets PHP'ed and HTML comes back to my browser. If I wanted to, I could then save the source for that HTML on my PC. Using PHP though, how would I get to do all that? I can't just ask the remote server for a file called index.html 'cos the html doesn't exist until the server-side PHP produces it. Somehow, I have to fool the server into getting it's PHP engine to produce my page of HTML. Any ideas. Quote Link to comment https://forums.phpfreaks.com/topic/83864-solved-how-do-i-get-php-to-get-web-page-from-another-site/#findComment-426797 Share on other sites More sharing options...
revraz Posted December 31, 2007 Share Posted December 31, 2007 See if CURL does what you want. http://www.phpfreaks.com/forums/index.php/topic,174953.0.html Quote Link to comment https://forums.phpfreaks.com/topic/83864-solved-how-do-i-get-php-to-get-web-page-from-another-site/#findComment-426799 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.