PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

I would like to browse to a url eg http://mysite.com/index.html and dump the content of that site in a variable eg $htmlDump?


You will need to ensure that you have permission to do this from the site owner, because effectively you are indexing an entire web page by doing this. Remember that you will also be causing a load on a site, so you should do this on your site only, or if you will be using this to store/retrieve information from other websites you must ask their permission before doing so.

Anyhow, the PHP for this is very simple - you can just use the file_get_contents function like this:

<?php

$blah 
file_get_contents("the-url-goes-here");

//$blah now contains the content of that web page

?>



Comment on this Question and Answer >>>

ASK A QUESTION

More website PHP Questions

How can I access information sent through POST on a form?

How do I perform a 301 redirect with PHP?

how can i add a chatbox to my site?

how to get gmail inboxmessages in php using username and password

Can you write the PHP for my website for me?



Custom Search