WordPress.org

Ready to get started?Download WordPress

Forums

Running PHP in pages (5 posts)

  1. basketball
    Member
    Posted 8 years ago #

    Hey does anyone know how I could run PHP in pages or posts. I tried run php, and PHP exec;

    http://mark.scottishclimbs.com/archives/2004/07/02/running-php-in-wordpress-posts/
    and
    http://priyadi.net/archives/2005/03/02/wordpress-php-exec-plugin/

    respectively, but both of them just outputted "PHP –>"

  2. joshmac
    Member
    Posted 8 years ago #

    I am using runphp and it works great. I viewed one of the sites that suggested away to do it, but not really. If your php code is:

    <?php
    $stat = array();
    $tremont = 'street';
    </php>

    then the way to place it in a post is this way:

    <phpcode>
    $stat = array();
    $tremont = 'street';
    </phpcode>

    The same goes for inclusions. I hope this helps.

  3. basketball
    Member
    Posted 8 years ago #

    Thanks parkstreet, I tried using both ways for PHP exec and neither worked, but your way with run php works fine. Thanks again

  4. basketball
    Member
    Posted 8 years ago #

    Edit: NVM

  5. Sproke
    Member
    Posted 8 years ago #

    How did you fix this problem? Are you running WP1.5.1.2 because I'm having problems running php in pages too.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags