Problems including php in html
Posted by: EarlW
Posted on: 2007-07-04 08:01:00
I have several Dreamhost domains - and php works on all of them, so I shouldn't have to do anything to .htaccess. The following works in an shtml file:
<!--#include virtual="/full/path/tofile.php" -->
-which includes output of a php page on the same domain.
However, I want to be able to include that same output in an html file on another domain (under a different user account). None of the following work. Help?
<?php
$fileOutput=implode('',file('http://www.yoursite.com/full/path/tofile.php'));
?>
<?php
readfile("http://www.yoursite.com/full/path/tofile.php");
?>
<?php
include("http://www.yoursite.com/full/path/tofile.php");
?>
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.yoursite.com/full/path/tofile.php");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
?>