Urgent help needed with PHP code in a wordpress post.

Discussion in 'Programming' started by loktakwah, Sep 26, 2008.

  1. #1
    I'm in a real bad spot atm and need some serious help.

    I was putting php code in posts in wordpress using a plugin: execPHP.

    Everything was working fine all day. I don't know what changed, but now, no PHP code is converting. I've tried two plugins, execPHP and runPHP, both with the same results.

    http://www.pokerjuke.com/?p=928

    The entire post of that was written in the regular html (not WYSIWYG).
    The posts contents are:

    Learn how to correctly use a pushbot chart for late-stage tournament play.
    
    <?php
    global $userdata;
    get_currentuserinfo();
    $userid = $userdata->ID;
    
    echo ('<a href="http://www.pokerjuke.com/buynew.php?subid='.urlencode($userid).'&item=pushbotguide"><span style="color: blue;"><span style="text-decoration: underline;">Pushbot Video Guide</span></span></a>');
    ?>
    Code (markup):
    The things I fiddled with that might have caused this issue:

    I unchecked the "Use the visual editor when writing" box in the admin panel.

    I changed roles of a user. I know you can set user permissions to who can run php code. The code was written by an admin with access.

    That's about all I did. The only reasonable thing I think that could have caused this is disabling the visual editor. I have checked the box again and tried making new posts but I still get the same problem. Plus, I remember viewing pages after making that change and they were fine.

    I don't remember editing anything at all in between when pages went from working to broken.

    I'm very worried that my site is going to need a complete rebuild now. Can anyone think of anything that might save me from that?

    Any help or ideas are much appreciated. I'm new to this stuff and completely lost :(
     
    loktakwah, Sep 26, 2008 IP
  2. javaongsan

    javaongsan Well-Known Member

    Messages:
    1,054
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #2
    If are using this code on every post, put it directly in your theme page.
     
    javaongsan, Sep 26, 2008 IP
  3. loktakwah

    loktakwah Well-Known Member

    Messages:
    109
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #3
    Fixed :) I wasn't using it on every page. I added an if statement to check which category the post was in and only add the code on those pages.

    Thanks.
     
    loktakwah, Sep 26, 2008 IP