Title: Including PHP inside Pages
Last modified: August 18, 2016

---

# Including PHP inside Pages

 *  Resolved [davedelong](https://wordpress.org/support/users/davedelong/)
 * (@davedelong)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/including-php-inside-pages/)
 * Hi,
 * How can I have PHP code execute inside pages? I want to make a contact form on
   a Page, but all my <?php ?> stuff just prints out like text.
 * Thanks,
 * Dave

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Michael Bishop](https://wordpress.org/support/users/miklb/)
 * (@miklb)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/including-php-inside-pages/#post-228612)
 * One option would be to design a template with the php hardcoded into the page,
   an easier option is to use a [plugin like PHP Exec](http://priyadi.net/archives/2005/03/02/wordpress-php-exec-plugin/)
   as I use. It provides a simple quicktag that insert when writing the Page, then
   you just add the code. Works like a charm for me.
    I do believe there’s at least
   one other plugin, in all fairness.
 *  [pascalou127](https://wordpress.org/support/users/pascalou127/)
 * (@pascalou127)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/including-php-inside-pages/#post-228627)
 * Hi,
    I use [runPHP](http://www.nosq.com/2004/10/runphp-wordpress-plugin/) to 
   have php code in my posts.
 * If you want a contact form you might want to take a look at [WP-ContactForm](http://ryanduff.net/projects/wp-contactform/)
   which is also very nice plugin.
 *  Thread Starter [davedelong](https://wordpress.org/support/users/davedelong/)
 * (@davedelong)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/including-php-inside-pages/#post-228668)
 * Thanks!
 * I wasn’t able to get runPHP working immediately, so I decided to give PHP Exec
   a try. That seems to work fine.
 * That WP-ContactForm is a rather nifty plugin! Thanks for pointing it out.
 * Thanks a bunch!
 * Dave
 *  [FriendlyWP](https://wordpress.org/support/users/mmcginnis/)
 * (@mmcginnis)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/including-php-inside-pages/#post-229220)
 * Is anyone else just not able to get any of these plugins to work? Installed and
   activated both RunPHP and PHP Exec and when I type
 * <phpcode>
    <?php get_links(2, ‘<span>’, ‘</span>’, ”, TRUE, ‘url’, FALSE); ?>
   </phpcode>
 * into a page or post edit textarea and save it shows up on the post or page exactly
   as typed above.
 * I’d really like to get this to work, because I like to switch out my template/
   look and feel fairly frequently and it’s driving me nuts having to recreate all
   page/template functionality every time I choose a new template set. Does that
   make sense?
 * Thanks, Michelle
 *  [McShelby](https://wordpress.org/support/users/mcshelby/)
 * (@mcshelby)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/including-php-inside-pages/#post-229221)
 * You could also try my [Exec PHP](http://soeren-weber.net/post/2005/08/18/50/)
   plugin. I wrote it specifically because of issues when also using quotes in the
   posts.
 *  [Roar](https://wordpress.org/support/users/rori/)
 * (@rori)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/including-php-inside-pages/#post-229222)
 * McShelby, I just used your plugin and it ROCKS. Works perfectly on my page.
 * [http://www.tuckle.net/?page_id=3636](http://www.tuckle.net/?page_id=3636)
 * On that page I run the todayAgo plugin. So thank you!
 *  [jonerik](https://wordpress.org/support/users/jonerik/)
 * (@jonerik)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/including-php-inside-pages/#post-229223)
 * i dont get it to work, my wp just makes a space in the middle of < and the ? 
   so it gets like < ? php include(‘………’) ?>
 * edit: now i get it to work BUT!
 * I get this error.
    Parse error: parse error, unexpected T_INCLUDE in /www/htdocs/
   spoken/wp-content/plugins/runphp.php(96) : eval()â€™d code on line 1

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Including PHP inside Pages’ is closed to new replies.

## Tags

 * [execute](https://wordpress.org/support/topic-tag/execute/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 7 participants
 * Last reply from: [jonerik](https://wordpress.org/support/users/jonerik/)
 * Last activity: [20 years, 6 months ago](https://wordpress.org/support/topic/including-php-inside-pages/#post-229223)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
