WordPress.org

Ready to get started?Download WordPress

Forums

RunPHP on Pages (4 posts)

  1. Amulet
    Member
    Posted 9 years ago #

    I've been using RunPHP for several days, and it's worked fine, until now. I've been able to use it on pages, but I'm creating new pages right now, putting all my fan fiction into WP, and it's acting funny. I'll create the page, making sure to check the eval() box, and it'll create the page, but when I view it, the PHP code (specifically, two PHP echo() calls) shows up unparsed (I think that's the correct term--I'm not a PHP coder, but I know a bit). I have to go to Manage Pages and click Edit for the page in question, and it'll show eval() as unchecked, and the two echo() calls have changed from this:

    [code]
    <?php echo _CALL; ?>
    [/code]

    to this, putting a space between the less-than sign (<) and the first question mark:

    [code]
    < ?php echo _CALL; ?>
    [/code]

    I have to re-check the eval() box and move the question mark back to the less-than sign. I have a bunch of pages left to create, and this is pretty tedious. Anyone know what's going on?

    Ok, I'm adding a bit more, because I found something else odd. I just created a page for a multi-part fanfic I did, and I have more PHP echo() calls than in my one-part fics, but those extra calls remained fine. It's only the echo() calls in the information part of my fics that are having the problem. Specifically:

    [code]
    <B>CONTACT:</B> <?php echo _CALL1; ?><BR>
    <B>AUTHOR'S WEBSITE:</B> <?php echo _CALL2; ?><BR>
    [/code]

    is changing to:

    [code]
    <B>CONTACT:</B> < ?php echo _CALL1; ?><BR>
    <B>AUTHOR'S WEBSITE:</B> < ?php echo _CALL2; ?><BR>
    [/code]

    And, of course, the eval() box becomes unchecked. What's going on with this?

  2. skippy
    Member
    Posted 9 years ago #

    I experienced the same thing. I never found a fix, so just continued to live with the work-around you've already discovered.

    If your pages are all following the same template, you could remove RunPHP altogether and create a page template.

  3. Beel
    Member
    Posted 9 years ago #

    I was running RunPHP on another site, but then David Chait came out with his CG-QuickPHP which I tested on my site. I am in the process of switching the other site over. Activate the plugin and enter PHP in the post with <quickphp Whatever_function() /> - simple but effective. I'm sure this one David will improve upon.

  4. davidchait
    Member
    Posted 9 years ago #

    Yes, if you are doing singular function calls (with no params or simple non-code ones), CG-QuickPHP is an easy approach and may be a teensy bit faster in some cases. Where the examples given were all really HTML plus single function calls, it would probably work fine for you.

    I also agree with Skippy: if you are doing complex page coding, you are much better off doing the code in a custom page template rather than using something like RunPHP. Custom templates can get optimized by the php pre-compilers (Zend Optimizer, et al), as well as not getting 're-processed' by a plugin or WP itself as body content.

    But, if you want the stuff embedded in body content, and you want to be able to edit the pages/posts within WP, CG-QuickPHP might be a 'quick' (<grin>) solution for your one-shot function calls.

    -d

Topic Closed

This topic has been closed to new replies.

About this Topic