I need plugin to run php inside a wordpress post

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • spacedog
    Yes that IS me. Bitch.
    • Nov 2001
    • 14149

    #1

    I need plugin to run php inside a wordpress post

    I just tried phpexec & runphp, neither of which work.

    Anyone got or know wordpress plugin that will allow me to run php inside a wordpress post?
  • teksonline
    So Fucking Banned
    • Jan 2005
    • 2904

    #2
    Exec-PHP is what to use no?

    Comment

    • spacedog
      Yes that IS me. Bitch.
      • Nov 2001
      • 14149

      #3
      Originally posted by teksonline
      Exec-PHP is what to use no?
      I tried that, didn't work.

      I embedded code in between the tags and wordpress post shows the code instead of what the php is telling it to show

      Comment

      • V_RocKs
        Damn Right I Kiss Ass!
        • Nov 2003
        • 32449

        #4
        Read the comments on Exec-php page and you will find a link to the new version that does work.

        Comment

        • media
          Confirmed Moneymaker
          • Apr 2002
          • 9853

          #5
          Originally posted by spacedog
          I tried that, didn't work.

          I embedded code in between the tags and wordpress post shows the code instead of what the php is telling it to show
          Make sure you are editing in the "CODE" tab only and saving in the "CODE" tab.. once edited in the WYSIWYG editor it will fubar it... exec-php is great
          I'm here for the violence!

          Comment

          • ~Ray
            visit hardlinks.org
            • Jun 2003
            • 18361

            #6
            adman for wordpress in the www.wordpress.org plugins

            wp.uberdose.com/2006/11/05/adman/
            Last edited by ~Ray; 12-28-2007, 01:39 PM.
            Adult Backlinks for Adult Websites - Testimonials Available

            Comment

            • D Ghost
              null
              • May 2006
              • 9820

              #7
              Yeah make sure you aren't using Visual editor. If you need help I am expert at Wordpress... hit me up

              Comment

              • Twig
                Confirmed User
                • Nov 2005
                • 1949

                #8
                +1 for exec-php.

                Comment

                • pip
                  So Fucking Banned
                  • Nov 2005
                  • 468

                  #9
                  Turn the stupid visual editor off, its pointless

                  Comment

                  • spacedog
                    Yes that IS me. Bitch.
                    • Nov 2001
                    • 14149

                    #10
                    I have visual editor off and also have role manager plug in.

                    I have tgp on root & blog in dir.

                    Script is in root & I'm trying to include tgp script in post or page thats on blog in dir as;

                    Code:
                    <?
                     include("../script.php");
                     $query   = "SELECT COUNT(url) AS numrows FROM links";
                     $result  = mysql_query($query) or die('Error, query failed');
                     $row     = mysql_fetch_array($result, MYSQL_ASSOC);
                     $numrows = $row['numrows'];
                     
                     $maxPage = ceil($numrows/65);
                    
                     $sql = "SELECT url, title, date FROM `links` ORDER BY date DESC LIMIT ".$offset.", 65;";
                     $rs = mysql_query($sql);
                     echo mysql_error();
                     
                     
                     $self = $_SERVER['PHP_SELF'];
                     $nav = '';
                     for($page = 1; $page <= $maxPage; $page++)
                     {
                        if ($page == $pageNum)
                        {
                            $nav .= " $page ";
                        }
                        else
                        {
                            $nav .= " <a href=\"$self?page=$page\">$page</a> ";
                        }
                     }
                    
                    while($row = mysql_fetch_row($rs)){
                         echo "<a href=\"".$row[0]."\">".$row[1]."</a>".$row[2]."\n<br>\n";}
                    
                     echo "<p>Page: ";
                     $self = $_SERVER['PHP_SELF'];
                     $nav = '';
                     for($page = 1; $page <= $maxPage; $page++)
                     {
                        if ($page == $pageNum)
                        {
                            $nav .= " $page ";
                        }
                        else
                        {
                            $nav .= " <a href=\"$self?page=$page\">$page</a> ";
                        }
                     }
                    
                    echo $first . $prev . $nav . $next . $last;
                     mysql_close();
                    ?>
                    and I end up with on the post
                    Code:
                    You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ? 65′ at line 1
                    Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /dirname/0/blahblah/htdocs/file/name/wp-content/plugins/exec-php/runtime.php(41) : eval()?d code on line 29

                    Comment

                    • V_RocKs
                      Damn Right I Kiss Ass!
                      • Nov 2003
                      • 32449

                      #11
                      This is because $offset isn't holding a value.

                      How is offset being passed to your script?

                      If it is by the address (GET) then you need something like:
                      Code:
                      $offset = $_GET['offset'];
                      This is because your server might have register globals turned off for security reasons.
                      Last edited by V_RocKs; 12-28-2007, 10:00 PM.

                      Comment

                      • remii
                        Confirmed User
                        • Jan 2006
                        • 226

                        #12
                        run_php works great for me !
                        http://dev.wp-plugins.org/wiki/RunPHP

                        Comment

                        • spacedog
                          Yes that IS me. Bitch.
                          • Nov 2001
                          • 14149

                          #13
                          Originally posted by V_RocKs
                          This is because $offset isn't holding a value.

                          How is offset being passed to your script?

                          If it is by the address (GET) then you need something like:
                          Code:
                          $offset = $_GET['offset'];
                          This is because your server might have register globals turned off for security reasons.
                          It's not the server. Scripts running fine on the main page.

                          So I have this text tgp for a bit on domain.com then decided to add a blog on domain.com/blog and now I'm trying to include the script in a blog post or a blog page so I can move blog to domain.com & still have the text tgp present on the site.

                          Comment

                          • The Duck
                            Adult Content Provider
                            • May 2005
                            • 18243

                            #14
                            exec-php should do the trick
                            Skype Horusmaia
                            ICQ 41555245
                            Email [email protected]

                            Comment

                            • spacedog
                              Yes that IS me. Bitch.
                              • Nov 2001
                              • 14149

                              #15
                              Originally posted by kandah
                              exec-php should do the trick
                              But it's not. This is what I'm trying to get to work & am getting the errors shown in post above

                              Comment

                              Working...