Hello,
I have been stuck on this one for a few days and have put off posting a thread until I was satisfied I had exhausted all attempts to get this to work.
I have a perl script (script.pl). In a separate folder I have header.php and footer.php. Note that header.php also includes 2 other php files and also another perl file. I simply want to print the output of header at the top of script.pl and the output of footer at the bottom of script.pl.
I have tried numerous methods but keep coming back to this one:
This pretty much prints the unexecuted contents of the perl script i'm running the code from.
This does nearly what I want:
However it prints "nearly" everything in the sourcecode, but the stylesheet, javascript etc is never picked up.
I have even tried using a php method (print header, execute perl script, print footer) which works great however the perl script requires param data and I have had issues passing the data from the php script to the perl script (either passing the variables through a url OR passing arguements using exec).
How can I print header.php and footer.php in my perl script? I have found tonnes of information across the web, however nothing seems to work for me.
Thank you,
Chris
I have been stuck on this one for a few days and have put off posting a thread until I was satisfied I had exhausted all attempts to get this to work.
I have a perl script (script.pl). In a separate folder I have header.php and footer.php. Note that header.php also includes 2 other php files and also another perl file. I simply want to print the output of header at the top of script.pl and the output of footer at the bottom of script.pl.
I have tried numerous methods but keep coming back to this one:
Code:
my $path = getcwd();
my $header = `usr/bin/php -q $path/Header.php`;
print $header;
This pretty much prints the unexecuted contents of the perl script i'm running the code from.
This does nearly what I want:
Code:
my $path = getcwd();
my $header = `lynx -source $path/Header.php`;
print $header;
However it prints "nearly" everything in the sourcecode, but the stylesheet, javascript etc is never picked up.
I have even tried using a php method (print header, execute perl script, print footer) which works great however the perl script requires param data and I have had issues passing the data from the php script to the perl script (either passing the variables through a url OR passing arguements using exec).
How can I print header.php and footer.php in my perl script? I have found tonnes of information across the web, however nothing seems to work for me.
Thank you,
Chris