• Hello

    Thank you for awesome plugin to the wordpress. But I came up with the problem using this plugin. The problem is, whenever I want to to declare some function for example: [insert_php]
    $val = ‘hello’;
    function sayval($val)
    {
    echo “value is $val”;
    }
    sayval($val);
    [/insert_php]
    I will give me this error:”Fatal error: Cannot redeclare sayval() (previously declared in C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb\wordpress_osada\wp-content\plugins\insert-php\insert_php.php(48) : eval()’d code:3) in C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb\wordpress_osada\wp-content\plugins\insert-php\insert_php.php(48) : eval()’d code on line 6″. The solution that I found is that I just remove the code from function and it works, but I am not able to use php function, which I need to use. I checked that I declared the function only once. Could you please help me ?
    Thank you,
    Martin

    https://ww.wp.xz.cn/plugins/insert-php/

Viewing 1 replies (of 1 total)
  • Martin, perhaps the utilities you’re using somehow duplicate the PHP code. Try it on a test page of a live WordPress installation on the internet.

    I say that because I had no problem with this:

    <hr>
    [insert_php]
    $val = 'hello';
    function sayval($val)
    {
    echo "value is $val";
    }
    sayval($val);
    [/insert_php]
    <hr>

    (copied verbatim from my test page).

    Will

Viewing 1 replies (of 1 total)

The topic ‘Not working function statement’ is closed to new replies.