|
Posted by Rik on 03/14/07 08:28
Gladen Blackshield <gladen@verizon.net> wrote:
> Each and every image I attempt to display (either through striaght PHP
> or a
> call through an IMG link) shows up as RAW-DATA text.
>
> ?PNG IHDRôiåLM@ IDATxo¬½Y",¹Z&ö
> Putting in the HEADER command nets:
>
> Warning: Cannot modify header information - headers already sent by
> (output
> started at /home/karstens/public_html/test/imgtest.php:9) in
> /home/karstens/public_html/test/imgtest.php on line 11
>
> and then the file output as raw data.
Yes, the header() should come _before_ any other output. You output
something on line 9 (or before). Either this should not be outputted, or
the header() function should be earlier in the script. Keep in mind that
any whitespace/characters outside <?php ?> tags are considered output, so
in this file:
-----wrong.php---
<?php
$foo = 'bar';
?>
<?php
//rest of code
------------------
Output will have started on line 4, so no header can be send.
--
Rik Wasmus
Posted on Usenet, not any forum you might see this in.
Ask Smart Questions: http://tinyurl.com/anel
[Back to original message]
|