Problems including php in html

software development

#1

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:

-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); ?>

#2

This helps?

http://wiki.dreamhost.com/KB_/Unix/.htaccess_files#How_can_I_use_ssi_on_files_with.html_extensions.3F

[color=#00CC00]ANONYMOUS0=>Max Discount[/color] [color=#6600CC]ANONYMOUS2=>Max - $1.[/color] Being mean doesn’t make you look smarter than him. And bigoted remarks are not appreciated on this forum.


#3

DreamHost disabled allow_url_fopen in their install of PHP. This means you can not use URLs instead of path names.

See the DreamHost Wiki article on CURL for examples of doing different things. The code you posted does what it says - fetches the content. You’ll need to do something with it once you have it, like save it to a file or output it to the browser.

:cool: openvein.org -//- One-time [color=#6600CC]$50.00 discount[/color] on [color=#0000CC]DreamHost[/color] plans: Use ATROPOS7


#4

This may seem like I’m stating the blindingly obvious, but why not just copy the relevant files to the alternate user account so that you can use a regular include() function?


si-blog | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]