Help!

Or search support forum

What's Global Moxie?

Global Moxie is the hypertext laboratory of Josh Clark, whose projects include the Big Medium web content management system. Josh creates web applications and websites from his multimedia studio in Paris, France.

What's Big Medium?

Big Medium is flexible, easy-to-use server software for creating and editing websites directly from your browser. Check out the features or download now.

Moxiemail

Enter your e-mail to receive occasional updates:

Can I include PHP code in my templates?

Question

Can I use PHP code in my templates?

Answer

Not directly. Big Medium generates .shtml pages, which are not parsed for PHP; any PHP code in those pages will not be processed.

You can, however, add server-side include tags to your templates to bring in PHP-generated markup from external files. You do this by moving each chunk of PHP code in your page into its own external PHP file, and then replacing that chunk of code with a SSI tag in the template. Here's how to do it.

Repeat these steps for every chunk of php code in your template:

  1. Copy and paste the code into an external file with its own unique name. For example, we'll call it: include.php

  2. Save the file to your webserver. For example, let's assume that your domain is example.com and you've saved this file here: www.example.com/php/include.php

  3. In your template, replace this chunk of PHP code with a SSI include tag like so:

    <!--#include virtual="/php/include.php" -->
    

The end result is that your template will include the results of each snippet of code from all of these external files.

Download Big Medium
Try it free for 30 days, or buy to unlock.

Simple, Elegant, Effective

"Hats off to Josh. I always wanted someone to do a program like this. Simple, elegant and effective."
—Kevin Osborn

"There are people here in my office so impressed with your dedication and support of your product that they are convinced that you are not just one person but a small army."
—Paul McBroome

"Just a short note to say thank you for the many hours of hard work and dedication you have put into your product, Big Medium. We are extremely pleased with our purchase. It's not just that we needed a CMS and are relieved to be using one, it's that we found one that is easy to work with and which met all the requirements that we needed to take our websites to the next level. It's exhilarating just thinking of the possibilities we now have at our fingertips!"
—MaggiLu Tucker

More praise for Big Medium