PDA

View Full Version : Can PHP be mixed with perl and html in the same script?


bazz
08-03-2004, 02:19 PM
My site presently relies heavily on perl and (obviously) html. :)

I will be moving over to php MySQL soon. I have found a script in PHP that is very useful to me potentially.

What I have presently is a perl file that provides a templet page which as the url clarifies which department I am viewing the perl script inserts the specifics for each department.

This html part of the perl file is written as a straightforward valid html code. Inside this html page I want to place a PHP script but that script must be able to use some of the variables from the perl script. Is this possible?

I need it to be able to pull an image variable from the perl file and then to apply the php script to that image.

Bazz

firepages
08-03-2004, 02:41 PM
If you were to ask if you could call perl scripts from PHP then the answer would probably be virtual() , the other way around probably an exec call but I do not know enough about PERL to say.

If you are moving to PHP then perhaps try asking for help converting your PERL script to PHP ?

bazz
08-03-2004, 02:47 PM
Firepages, that makes sense except for one thing.

The perl file contains a load of information that in the php format would probably be in theMySQL database. I haven't yet learnt PHP or MYSQL so I need to maintain the perl files for the present.

Thanks anyways

Bazz

firepages
08-03-2004, 03:08 PM
fair enough , if I needed to include a PHP file within another PHP file but could not simply include it for some reason then I would probably exec() it passing the arguments in the command line ..


@args = ( 'php -q /path/to/file.php arg1 arg2 arg3 etc' );
system @args;


thats assuming your PHP script will run as a CGI & requires no server var's ... errr or is it @args = ( "php /path/to/file.php" , "arg1" , "arg2" ,"arg3" ,"etc" ); ?

note that with the PHP CLI/CGI $_SERVER['argc'] & $_SERVER['argv'] should be available , or possibly in $_ENV array