Why isn't img src displaying the image?

Antony1992Antony1992 Nairobi
edited August 2016 in PHP

When using xampp to test the files,the upload works fine since the image can be seen on the database and the uploads folder but on the web page it appears for a second then disappears. When I tried on my website, the image was uploaded successfullly but did not appear even for a second. Am not getting any errors. I want the page to display permanently uploaded images by a user.The problem seems to be emerging on a the following div on my profile.php folder:

           <div class="media-content">
            <div>{{post}}</div>
            {{#is_photo}}
            <img src="uploads/scaled/{{photo44}}" alt="{{username}}"   />
            <p>{{caption}}</p>
            {{/is_photo}}
           </div>

The resulting html is empty. On the network log the image cannot be seen.

Comments

  • Are you sure that the URL points to the correct location on your webserver (right click an image and choose 'View Image in new Tab' or something similar, and check if the URL you see there is the one you are expecting)

  • If you can edit the HTML code then you could try including the image as a background, with the corresponding CSS included inline. Note that you'll have to explicitly define the dimensions of the image. Eg.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories