Page 1 of 1

Using Static Page that includes php, not HTML

Posted: Mon Oct 23, 2006 11:48 pm
by pharaoh
Hi there -

I have a small php script that I wanted to include as a static page. I've installed the Static Page module and Static Page Sidebar. When I edit a static page entry and insert the PHP code (disabling all markup), it doesn't work. I see bits and pieces of the php code. I presume that what I'm doing is including PHP inside of already existing PHP, so it doesnt' like it. Is there a way to link to a PHP page, yet have it come up within the template like any static HTML page would?

I suppose I could just use an HTML nugget with a link to the PHP, but that would open it full-page, outside of the template, menu systems, etc.

Thanks again for any suggestions/help!

Re: Using Static Page that includes php, not HTML

Posted: Tue Oct 24, 2006 10:45 am
by garvinhicking
Hi!

Serendipity never executes PHP code in entries or staticpages, because it is a huge security hole.

The easiest way to show a PHP script in your page is to use the wrapurl / iframe event plugin and then enter a URL you want to use. The other way is to use the includephp plugin that can include a PHP file on your server.

The best way actually is to create your own serendipity event plugin. You might want to search the forums for some examples or more information about the plugins mentioned above.

HTH,
Garvin