[mapserver-users] Sorta Off Topic - Putting PHP code in a CGI script?

Nyk Cowham ncowham at forumone.com
Thu Feb 28 17:34:56 EST 2002


> Hi guys, I'm new to both CGI and PHP, but saw an example 
> somewhere in a CGI
> script that allowed you to enter in raw HTML instead of putting in a
> separate PRINT command for it.  I cannot, for the life of me, 
> find this
> example again though.  I though it would allow me to easy put 
> in PHP stuff
> into my CGI script.
> I thought it went something like this:
> 
> .......
> $query->start_html;
> print "bleh bleh";
> ECHO END >>>>
> <B>This is bold</B>
> <? PHP script stuff ?>
> END <<<<
> $query->end_html;

You are referring to the CGI.pm module by Lincoln Stein. It is actually
part of the core module library that comes with all distributions of
Perl.

run 'perldoc CGI' to get the man page.

However, this is not going to help you integrate PHP scripts into your
CGI
application. To do that you need to make a call to the web server so it
can
compile the PHP code. This can be done fairly easily in situations where
you
need to include a standard header that includes PHP code. You can do
this 
using the LWP module (part of lib-www).

I also have some modules for making Perl aware of PHP sessions. However,
there
is much room for improvement for integrating PHP and Perl.

Nyk Cowham
Forum One Communications
http://www.forumone.com/
Communicate Collaborate Change the world 



More information about the mapserver-users mailing list