Posted by Janwillem Borleffs on 01/09/07 11:21
kenoli wrote:
> // Send header
> header("Content-type: image");
>
Invalid content-type, should be image/jpg, image/jpeg, image/gif or
image/png.
> The problem is that I want send an id to the echo_image.php file so I
> can tell it which record to select the image from. When I set a
> session variable in the first file and try to retrieve it in the
> second file like this:
>
> <?php
> $tid = $_SESSION['id'];
>
You are forgetting to start the session with session_start():
session_start();
$tid = $_SESSION['id'];
Alternatively, you could also pass the ID through the image URL and read it
from there:
echo "<img src='echo_image.php?id=$id' ...>";
Make sure that you check that the ID is actually a number.
JW
[Back to original message]
|