Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts

    T_VARIABLE error

    I keep getting this error

    Parse error: syntax error, unexpected T_VARIABLE in /home/rodgameo/public_html/mugging.php on line 45


    Here is the coding for line 44 and line 45.

    Code:
    LINE 44 - $page = "<table width='100%' border='1'><tr><td class=\"title\"><img src=\"images/title_exploring.gif\" alt=\"Exploring\" /></td></tr></table>"
    
    LINE 45 -    $page =$page."<p>You are exploring the mighty battle field, and another player jumps out and mugs you! "

  • #2
    Regular Coder
    Join Date
    Oct 2006
    Location
    Bristol
    Posts
    128
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You need semi-colons at the end of each line

    and you can use $page .= instead of $page = $page . ""

    Alex
    Last edited by Alex!; 06-09-2007 at 06:47 PM.
    Give me Rep if I was helpful and ignore if I wasn't ;)

    http://www.google.com <--use this before asking

    Nominate a Helpful Member


  • #3
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,027
    Thanks
    2
    Thanked 315 Times in 307 Posts
    Unless you did not include them in the posted code, both of those lines are missing the required semi-colon ; at the end of each statement.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #4
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    Ok thanks alot!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •