AW: [opencms-dev] Include PHP code?

Mark Miller mark.miller at hema.ch
Fri Dec 12 10:30:01 CET 2003


It depends what you want to do. I statically export my site to IIS and
use opencms as a cms and a kind of staging platform. If you want to be
able to parse the php from within an opencms site, you will probably
have to add the php directive to tomcat. I have no idea how this could
be done.

For static export I did the following with asp files ... It's probably
roundabout but it worked for me.

1. Created a plain text file called search.asp (doesn't matter where ...
it is not for export).

2. Placed all my asp code in it eg ...

<%' ********** ASP ************
  FormScope = "/"
  Bla bla bla bla bla bla bla ....
%>

you could just place your php in there.

3. Created the jsp to house the script
<%@ page session="false" %>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
<cms:include file="/system/modules/ch.hema.www/jsptemplates/hema.jsp"
element="head"/>
<p align='center'><cms:include
file="/system/modules/ch.hema.www/resources/aspscripts/search.asp"/></p>
<cms:include file="/system/modules/ch.hema.www/jsptemplates/hema.jsp"
element="foot"/>





PS. I don't mind direct mails ... but it is better if you send to the
group ... I still read it and everyone benefits by being able to search
on the problem.

-----Ursprüngliche Nachricht-----
Von: Markus Ruecker [mailto:markus.ruecker at mr-consult.net] 
Gesendet: 11 December 2003 14:52
An: 'Mark Miller'
Betreff: RE: [opencms-dev] Include PHP code?

Hi,
Sorry for the PM, but I think you can help me.
First, if it's better for you, we can speak german too :-)

How do you include your php-file in a html-file???
Let's say you want to include i.e. the following code:
<?php phpinfo() ?>
How can I include this into the html file? I need the html for the
navigation!
I tried it, but I don't get any output.

The OpenCms master-template is a jsp-file...

Maybe you can give me a short example...

Thank's for your help,
Regards
Markus...


> -----Original Message-----
> From: opencms-dev-admin at opencms.org 
> [mailto:opencms-dev-admin at opencms.org] On Behalf Of Mark Miller
> Sent: Thursday, December 11, 2003 12:59 PM
> To: opencms-dev at opencms.org
> Subject: AW: [opencms-dev] Include PHP code?
> 
> 
> I put any external code (php, asp) into blank files and then 
> import them into the page.
> 
> Whenever I put asp code into a 'page' type of page I seem to 
> loose all the asp code. So I just bundled up several useful 
> functions (mailing,
> search) into 'blank' pages and use these.
> 
> Hope it helps ... I did ask this too, but everyone said it 
> should work, however in my experience, it doesn't, unless you 
> use the method above. If anyone has a better idea, please let 
> us know, as it would be really useful for me too.
> 
> All the best,
> 
> mark
> 
> -----Ursprüngliche Nachricht-----
> Von: opencms-dev-admin at opencms.org 
> [mailto:opencms-dev-admin at opencms.org] Im > Auftrag von Markus 
> Ruecker
> Gesendet: 11 December 2003 12:35
> An: opencms-dev at opencms.org
> Betreff: [opencms-dev] Include PHP code?
> 
> Hi,
> 
> Please, can anybody tell me, how to include PHP-code into the 
> body of a page (not template). 
> I need this to run an external file and show the output at 
> the webpage...
> 
> Thanks,
> Markus...
> 
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, 
> please visit http://mail.opencms.org/mailman/listinfo/opencms-dev
> 
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, 
> please visit http://mail.opencms.org/mailman/listinfo/opencms-dev
> 
> 






More information about the opencms-dev mailing list