Reply to Re: Displaying pictures

Your name:

Reply:


Posted by Janwillem Borleffs on 01/15/06 03:05

gooze wrote:
> Actually the problem is not the selection from the DB, the real
> problem is, how do I display the pictures in the browser after I have
> them in the array? There are binary data in the queries result, and I
> have to feed the browser with it...
>

You could try to use someting based on the following:

<?php

session_start();

if (isset($_SESSION['img']) && isset($_GET['show'])) {
header("Content-Type: image/jpeg");
print base64_decode($_SESSION['img']);
exit;
}

// Prepare some test data
$binary = file_get_contents('103.jpg');
$array = array_fill(0, 3, $binary);

foreach ($array as $e) {
$_SESSION['img'] = base64_encode($e);
// Timestamp appended to prevent caching
echo '<img src="', $_SERVER['PHP_SELF'], '?', time(), '&show=1" />';
}

?>


JW

[Back to original 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

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