Site images do not appear on your iOS iphone or tablet

2

On the site: link the images do not appear when accessing iphones or ipads, I suspect it is because of this php code that resizes the original image:

<a href="?page=item&prod=<?php echo remover($exeprod['produto']);?>">
 <img src="thumb.php?img=admin/<?php echo $spr[0];?>&x=300&y=300&q=80" alt="" title=""/>
</a>

Does anyone know how to make the images appear or why they did not appear?

    
asked by anonymous 27.08.2014 / 17:59

2 answers

1

The reason for not appearing is that the file that should be an image in src (a jpg, png, gif or something) is a .php (thumb.php). The devices browser does not "accept" loading a php as an image ... what you can do is rename the file thumb.php to thumb.jpg for example. Thus the browser will accept to display its content as image.

Or ...

Call a method that returns you to the full url of the image, and fill in that value in src.

    
28.08.2014 / 15:25
1

Make sure your PHP is sending the correct mime-type in the images:

<?php

   header("Content-type: image/png");
   ...

The type is required for browsers to know what information is being served.

Normally the server sends the correct type when it comes to static files, but when you generate your file, you have to "warn" the browsers.

When it comes to generating HTML from PHP, this is not necessary since PHP itself sends the standard mime-type of HTML.

    
28.08.2014 / 16:04