PHP Embedded In Python

Keith vetter at lincom-asg.com
Wed Feb 9 10:13:28 EST 2005


> Well it depends on how php is installed. Is it a linux system? Do you
> know how to run a php script from the command line?

I'm running on Fedora Core 3.

To run php command line I just ran:
% php <php.script>
It spit something back at me.

Maybe I should lay out what I am doing a little more.

I have a website.

At the top of each html page in the website it looks like:
------------------
<?php
   include "header.html"
?>

.... HTML CODE ....

<?php
  include "footer.html"
?>
-------------------



In "header.html" it looks like:
-------------------
<?php
  include "access.php";    // A login cookie type thingy
?>
... HTML CODE FOR LOGO, COMMON MENU ETC...
-------------------


As the story goes... I decided to put a Wiki on the website.  I got
MoinMoin which is a Python based Wiki.  It's really cool.  MoinMoin
uses a python cgi to generate html pages.  MoinMoin configuration
allows you to put an optional header and footer for each displayed
page.  Straight html works fine; however, my "header.html" and
"footer.html" do not with the embedded php.  The resulting python
generated pages have the literal string <?php include "access.php"; ?>.

Maybe the answer is still to use the os call.

Thanks for your help.  My little brush with the Python community gives
me the feeling that you guys are friendly.  It's nice.




More information about the Python-list mailing list