SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Aug 2007
    Posts
    318
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Echo display image problem

    I am using the code below to display the image
    PHP Code:
    echo '<img src="/addons/class.upload/test/'.$name.'" border="0" height="50%" width="50%" alt="' $row['title'] .'" />'
    it doesn't display the image and on clicking on image properties it gives http://example.com/addons/class.upload/test/

    instead of http://example.com/addons/class.uplo...nfidence_1.jpg
    which is the actual image , i asked this question in the morning also and then someone gave me the above code but now it doesn't display the image

  2. #2
    SitePoint Addict
    Join Date
    Aug 2007
    Posts
    318
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by krishnakhanna View Post
    I am using the code below to display the image
    PHP Code:
    echo '<img src="/addons/class.upload/test/'.$name.'" border="0" height="50%" width="50%" alt="' $row['title'] .'" />'
    it doesn't display the image and on clicking on image properties it gives http://example.com/addons/class.upload/test/

    instead of http://example.com/addons/class.uplo...nfidence_1.jpg
    which is the actual image , i asked this question in the morning also and then someone gave me the above code but now it doesn't display the image
    I solved it, by writing

    PHP Code:
        $name $row['name'];
        echo 
    '<img src="/addons/class.upload/test/'.$name.'" border="0" height="50%" width="50%" alt="' $row['title']  .'" />'

    i was missing the first statement

  3. #3
    SitePoint Zealot Dachande663's Avatar
    Join Date
    Feb 2005
    Location
    Birmingham, UK
    Posts
    151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could just use your original code like so:
    PHP Code:
    echo '<img src="/addons/class.upload/test/'.$row['name'].'" border="0" height="50%" width="50%" alt="' $row['title']  .'" />'
    Web Developer & Geek: hybridlogic.co.uk ~ lukelanchester.com


Bookmarks

Posting Permissions

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