note 45609 deleted from function.imagejpeg by cmb
| From: | cmb@php.net | Date: | Tue, 04 Oct 2016 15:18:35 +0000 |
| Subject: | note 45609 deleted from function.imagejpeg by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-206749@lists.php.net to get a copy of this message | ||
Note Submitter: arjini at gmail dot com
----
Scenario:
When pointing your browser directly at a script outputting an image, it displays without
problem, but when using it in another page via html (i.e. : img src="x.php?yada=yada" ),
you get a broken image.
Reason:
*Any* extra data sent along with the image will cause it to not display on other pages. Extra
data may include, whitespace characters (check the begginings and ends of your files), or a call to
session_start(), which is what got me.
Summary:
If you're going to send an image DONT START A SESSION in the script that is outputting the
image, and make sure that the PHP delimiters are the first and last things in your file.