You are here: Re: Image issues « All PHP « IT news, forums, messages
Re: Image issues

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация