We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13312
    • 13 Posts
    Here are my greetings to the MODx community smiley

    I wonder why do I get this error: Parse error: parse error, unexpected $end in C:\Program Files\xampp\htdocs\kvt2\manager\includes\tmplvars.commands.inc.php(50) : eval()’d code on line 1 when I use a TV:
    @EVAL
    if(isset($_GET['user_id']))
    {
        $sql = "SELECT username FROM modx_web_users WHERE id={$_GET['user_id']}";
        return $modx->db->query($sql);
    }
    

    However if I use:
    @EVAL ?><?php
    if(isset($_GET['user_id']))
    {
        $sql = "SELECT username FROM modx_web_users WHERE id={$_GET['user_id']}";
        return $modx->db->query($sql);
    }
    

    ...the error message is gone, but the code still doest work.

    Thanks
      • 25663 MODX Staff
      • 12,272 Posts
      Try putting your code all on one line with the EVAL in the first line. This is a known problem with 095 that is fixed in the upcoming release.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 13312
        • 13 Posts
        Whooa, that was fast shocked
          • 25663 MODX Staff
          • 12,272 Posts
          We aim to please. wink Work for you?
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 13312
            • 13 Posts
            Thank you rthrash, that solved the problem, case closed smiley