Re: [PHP] includes || perl
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/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] includes || perl
Thank you, that worked like a charm :) I appreciate it. warm regards, Sebastian - Original Message - From: Ernest E Vogelsinger [EMAIL PROTECTED] To: Sebastian [EMAIL PROTECTED] Cc: php list [EMAIL PROTECTED] Sent: Sunday, February 23, 2003 6:37 PM Subject: Re: [PHP] includes || perl | 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/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] includes || perl
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? Virtual() may help here... www.php.net/virtual ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] includes || perl
Wow, thank you. That is perfect. I never heard of virtual() function, it really should also be located at: http://www.php.net/manual/en/function.include.php since it's a type of include. warm regards, Sebastian - [BBR] Gaming Clan http://www.broadbandreports.com - Original Message - From: John W. Holmes [EMAIL PROTECTED] To: 'Sebastian' [EMAIL PROTECTED]; 'php list' [EMAIL PROTECTED] Sent: Sunday, February 23, 2003 10:50 PM Subject: RE: [PHP] includes || perl | 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? | | Virtual() may help here... | | www.php.net/virtual | | ---John W. Holmes... | | PHP Architect - A monthly magazine for PHP Professionals. Get your copy | today. http://www.phparch.com/ | | | | -- | PHP General Mailing List (http://www.php.net/) | To unsubscribe, visit: http://www.php.net/unsub.php | -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] includes || perl
ah, I didn' see that. Thanks. warm regards, Sebastian - [BBR] Gaming Clan http://www.broadbandreports.com - Original Message - From: Leif K-Brooks To: Sebastian Sent: Sunday, February 23, 2003 11:17 PM Subject: Re: [PHP] includes || perl It is. See also require(), require_once(), include_once(), readfile(), virtual(), and include_path. Sebastian wrote: it really should also be located at: http://www.php.net/manual/en/function.include.php