I'm using passthru.php to serve co-op ads on html sites. I was looking at including a randomquote.php file. my.htaccess file looks like this <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} ^(.*).htm [NC,OR] RewriteCond %{REQUEST_FILENAME} ^(.*).html [NC] RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^(.*) /passthru.php?file=$1 </IfModule> AddType text/html .shtml AddHandler server-parsed .html Options Indexes FollowSymLinks Includes Code (markup): Using SSI doesn't work unless I remove the first part relating to passthru.php So as an alternative I tried adding an include to my passthru.php file like this. <?php if (!function_exists('file_get_contents')) { function file_get_contents($url) { $handle = fopen($url, 'r'); $string = fread($handle, 4096000); fclose($handle); return $string; } } include ('ad_network_216.php'); echo preg_replace ("/<\/body>/i", $ad_network . '</body>', file_get_contents(str_replace ('../', '', $_REQUEST['file']))); include ("randomquote.php"); ?> Code (markup): This outputs the quote right below the co-op ads. I would like to see them just above the co-op ads. Putting the include ("randomquote.php"); before the ad network include shoots the quote to the top of the page. Question is: How do I tell passthru.php where to put it? Or alternatively: How can I make SSI work in this setup?
Ideally you would need the output of randomquote.php to simply be dropped into a variable. Then include it before the preg_replace line and spit out the variable within the preg_replace line.
So if I want it to walk like the co-op script it has to talk like it. I was hoping I could B.S. my way through it since I'm still a cut and paste hack when it comes to PHP. Here is the basic random quote file. I'm searching for how to "drop this into a variable", but I'm afraid I might learn something.
$x = file_get_contents("randomquote.php"); Code (markup): include it before the preg_replace line and spit out the variable within the preg_replace line.
Thanks. I've made a few hundred guesses at what "it" is and how to spit out a variable. Haven't figured it out yet and the room is covered in saliva. Maybe I should dry off one of those php books...