PHP in PErl

G

Gary

I am calling a perl script that writes a WEB page - Plain and simple except
that the perl script also writes out some PHP processing. All works fine
when I just create an html file of the program but when I use perl to write
it the php tags are ignored ?

I have the apache Xbithack on so php is parsed for all html files and the
perl script says it is an html file as below.

This code is called from a WEB page

#!/usr/local/bin/perl
print <<END;
Content-type: text/html

<?php
SCRIPT etc etc
?>
END

PHP tags are just printed on the screen.

Any pointers.
Gary
 
J

Joe Smith

Gary said:
I am calling a perl script that writes a WEB page - Plain and simple except
that the perl script also writes out some PHP processing. All works fine
when I just create an html file of the program but when I use perl to write
it the php tags are ignored ?

PHP is processed on the server only when the server reads it from a file.
 
W

Wayne Power

Look at your first line - #!usr/local/bin/perl - does your perl binary
actually sit in /usr/local/bin/? Mine is in /usr/bin
Try $whereis perl

Wayne
 
G

Gary

Joe Smith said:
PHP is processed on the server only when the server reads it from a file.

So basically this will never work.

The reason for this is as follows.

I want to load an HTML page with PHP tags that then calls a CGI written in
Perl but also to pass it parameters. The perl program does some work, and
will then need to return resulkts to the PHP program for display . I guess I
could have the perl program write the results to a file and then have PHP
readc the file but this seems crude it at all possible anyway ?

Gary
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top