Help!

Or search support forum

What's Global Moxie?

Global Moxie is the hypertext laboratory of Josh Clark, a designer, developer, and author who offers workshops and consulting for iPhone app design. He’s also creator of Big Medium, a web content management system. Josh spins words and code from multimedia studios in Providence, RI, and 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.

On Shelves

Books by Josh Clark

Tapworthy: Designing Great iPhone Apps

Best iPhone Apps: The Guide for Discriminating Downloaders

iWork ’09: The Mising Manual

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.

Above and Beyond

"Big Medium is an awesome product! I don't know how I survived without it for so many years. Your support goes above and beyond anything I've experienced using any other software package."
—Leroy G. Blimegger Jr.

"I love Big Medium 2... It's the most powerful news/article/content manager I have seen for my type of sites in years."
—Don McP

"Congrats on a job well done with Big Medium 2. This is by far the most amazing software anyone can buy for under $10,000."
—Steve Carter, Hometown Times

More praise for Big Medium