WordPress.org

Ready to get started?Download WordPress

Forums

Exec-PHP
PHP not giving correct results (1 post)

  1. CharlesJDillon
    Member
    Posted 10 months ago #

    Hi, I am trying to get Exec-PHP to work, in testing I tried just a test global code that you can use to make sure your php is working.

    <?php
    $a = 1;
    $b = 2;
    
    function Sum()
    {
        $GLOBALS['b'] = $GLOBALS['a'] + $GLOBALS['b'];
    } 
    
    Sum();
    echo $b;
    ?>

    Everywhere else the answer is 3 of course, but for some reason when I run it through on my WordPress site using Exec-PHP it is giving me the answer of 2.

    Eventually I would like to run table data from a MySQL but if it is not even giving me the right answer for a generic global...I am not sure where the problem is.

    http://wordpress.org/plugins/exec-php/

Reply

You must log in to post.

About this Plugin

About this Topic

  • RSS feed for this topic
  • Started 10 months ago by CharlesJDillon
  • This topic is not resolved
  • WordPress version: 3.6