www.webdeveloper.com
Results 1 to 5 of 5

Thread: could you please help about this error message

  1. #1
    Join Date
    Mar 2007
    Posts
    49

    could you please help about this error message

    I'm trying to control the size of image using this line of code.

    Code:
    echo "<img src=\"images/". $row['name'] . "\" alt=\"\" height="150" width="234" /> <br /></td></tr>";
    when use this tag to control size of images
    Code:
    height="150" width="234"
    it displaying this error message and line31 is that first line of code above.

    Parse error: syntax error, unexpected T_LNUMBER, expecting ',' or ';' in C:\wamp\www\upload\images1.php on line 31.

  2. #2
    Join Date
    Nov 2003
    Location
    Worthington, OH, USA
    Posts
    3,634
    Try:
    PHP Code:
    echo "<img src=\"images/"$row['name'] . "\" alt=\"\" height=\"150px\" width=\"234px\" /> <br /></td></tr>"
    54 68 65 42 65 61 72 4D 61 79

  3. #3
    Join Date
    Apr 2007
    Posts
    1,664
    or use single quotes outside then you don't have to escape the double quotes inside.

    PHP Code:
    echo '<img src="images/'$row['name'] . '" alt="alt text here" height="150" width="234" /> <br /></td></tr>'
    Anti Linux rants are usually the result of a lack of Linux experience, while anti Windows rants are usually a result of a lot of Windows experience.

  4. #4
    Join Date
    Mar 2007
    Posts
    49
    thank. it works

  5. #5
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,175
    And just FYI, single quotes are OK for HTML attribute values, so you could do the inverse:
    PHP Code:
    echo "<img src='images/"$row['name'] . "' alt='' height='150' width='234' /> <br /></td></tr>"
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles