My answer is in the topic. It doesn't matter if I have to use a .php or .html page, I just need it to be external.
File must be .php, to be handled as PHP. Example: ( see example 16.7 ) http://www.php.net/manual/en/function.include.php
eugen no ... you can include .html , and now answering both , this is legit <?php include("filename.html"); ?> PHP: or <?php include("http://www.example.com/filename.html"); ?> PHP:
I would just like to clarify something... although you can include a file from another site, when you include a file (any file... local or remote) via HTTP, you are including the PARSED OUTPUT of that file. That is to say, imagine a remote file called hello.php, and imagine it's code is: <?php print 'Hello World!'; ?> Now, imagine including that remote file via HTTP. The result doesn't include: <?php print 'Hello World!'; ?> it just includes: Hello World! as your include via HTTP includes the parsed output: that is to say, the remote server will parse the PHP file and print 'Hello World!'. Your include will include that output... not the actual code itself. If you wanted to include a PHP file that was just configuration settings, you would end up including nothing, assuming the file itself doesn't print anything. Hopefully that makes sense!
also, you need certain settings in your php.ini to be correct. Else, including remote files wont work. I believe this is allow_url_fopen
Yes include remote files wont work if you want to display the remote site data then you can open that page in iframe that is the only solution I think so.
That's not exactly correct... you can include remote files, but it will only include the output of the file (as I said). The net effect of including via HTTP is generally the same as using an iframe...
ob_start is to handle output buffering. I don't understand how it would work in this situation. curl would definitely work but I suspect it would be like driving in a thumb tack with a sledge hammer. Supposed to be more stable though.
dont see how cURL is so bad, make a function url_open and use it globally, not difficult. And if you have cURL installed its only a few lines of code....
It is a huge security risk to include remote files. The php.ini setting allow_url_fopen must be turned on for it to work. I can't say I've ever tried this but I believe if you include a straight text file like a ".inc" you can get it to execute locally instead of remotely.
That's true, that should work. Major security risk as far as 'information leakage' can go, but it would work
As TwistMyArm said it is possible to include remote files but you will be including the processed output only. if you use the following code <?php include 'http://www.google.com/';?> Code (markup): you can see the google homepage as the output of the page. Unless you have complete access to the remote file and what content it will be providing, it is highly adviced not to it because if you do not have control over the content of the remote file then it can be used to gain access to your server.
Thanks everyone for the advice. I will implement it today. Oh, and I do control the content of the remote content. Thanks again.