Re: includes || perl

From: Date: Sun, 23 Feb 2003 23:37:08 +0000
Subject: Re: includes || perl
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-136782@lists.php.net to get a copy of this message
At 00:26 24.02.2003, Sebastian said: --------------------[snip]-------------------- >I have a php script with an include("mydomain.com/script.pl"); it includes a >bit of perl, but will not include it if I do it using /home/path/ only full >URL, and when i use the full URL it causes one of my other php includes not >to function correctly. > >unfortunately, I do not think <!--#include file=" >will work inside a .php file.. any solutions? --------------------[snip]-------------------- I believe you cannot direct Apache to allow both PHP and the server-parsed handler to work on the same URL. You could however execute your perl script as URL with PHP being the client, and add the output of this script to the output of your page, something like <?php // do some stuff // now call your script $buffer = null; $hf = fopen('http://localhost/myscript.pl', 'r'); if ($hf) { while ($chunk = fread($hf, 4096)) $buffer .= $chunk; fclose($hf); } // include the script's output in your page echo $buffer; This is basically what Apache does when it encounters an SSI directive. -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/

« previous php.general (#136782) next »