Using Static Page that includes php, not HTML

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
pharaoh
Regular
Posts: 8
Joined: Mon Oct 23, 2006 11:12 pm

Using Static Page that includes php, not HTML

Post 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!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Using Static Page that includes php, not HTML

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply