WordPress.org

Ready to get started?Download WordPress

Forums

WP Messes up PHP when using the runPHP plugin (3 posts)

  1. jpr1011
    Member
    Posted 7 years ago #

    Hi, im kind of a WP noob, so this may be fixable with some option that I overlooked or something.

    I'm using a plugin called runPHP, which is supposed to execute PHP code in your posts and pages. I have it all installed and activated and working fine with one exception.

    Whenever I post PHP code, WordPress filters it and replaces special characters with HTML codes.

    For example, if I use ">" as an operator in PHP, WP replaces it with ">" which causes some errors in the PHP.

    The only way I have to insert unfiltered PHP is to directly edit my mySQL DB, which is fine for now, but isn't going to fly if i get more authors.

    I am fine with modifying it so that it doesn't filter my posts like that at all, I just don't know how to do it.

    P.S: Yes, I am using the "code" tab to enter my PHP code.

  2. I use the Exec-PHP plugin myself but have had this problem too.

    The solution is to go to the My Profile link in your dashboard (top right of the page), turn off the "Use the visual editor when writing" option (make it un-checked) and save your profile.

    Once that is done then you should be able to embed PHP code.

    Embedding PHP code into your posts won't work even using the "Code" tab in the editor (as you have found out).

    I only embedded PHP in pages and not posts. So doing this with a page that I only change once in a blue moon works for me. For posts I turn the visual editor back on.

  3. FurrTrap
    Member
    Posted 7 years ago #

    @jdembowski:

    Thanks for the link to Exec-PHP, I just tried it with WP 2.2.1 and it works just fine in my posts.

    I'm just using it so I can code all my hyperlinks with get_bloginfo() it makes site cloning much easier.

    Great stuff, my workflow is now much more elegant :)

Topic Closed

This topic has been closed to new replies.

About this Topic