what's wrong with these codes?

Discussion in 'PHP' started by jonhyhar, Apr 3, 2010.

  1. #1
    when i wrote this,


    {php}
    $id = "{/php}{$user->user_info.userid}{php}";
    echo $id;
    {/php}
    PHP:
    it seems this on the page

    echo Array['user']->user_info['userid'];
    Code (markup):
    so, why it doesnt work?
     
    jonhyhar, Apr 3, 2010 IP
  2. learnerabn

    learnerabn Peon

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    please be sure it is curly braces{php} or square brackets
    
    and then whatis the $user->user_info.userid means to you? 
    is $user a php variable,if it so then why are you using it out of the scope of the php.
    PHP:
     
    learnerabn, Apr 3, 2010 IP
  3. jonhyhar

    jonhyhar Active Member

    Messages:
    166
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3
     
    jonhyhar, Apr 3, 2010 IP
  4. Brandon.Add.On

    Brandon.Add.On Peon

    Messages:
    178
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You would have to specify which template engine you are using to we can verify it's syntax.
     
    Brandon.Add.On, Apr 3, 2010 IP