Reply to Re: Pulling jpeg name images out of MySQL onto PHP page

Your name:

Reply:


Posted by ctclibby on 06/06/06 23:40

MS wrote:
[snip]
> straightforward code to show me how to do this? Is there a better way
> that is not too complicated? Remember, I am a newbie.

Straightforward? Boy, am not sure if you want to display this image
inline or as an image src...

For inline, you need to open the image file:

$Image = imagecreatefromjpeg($ImageName.jpg)

..... do stuff with the image here if you wish...

header("content-type: image/jpeg")
imagejpeg($Image)
?>

Image already exists as a .jpg on disk NOT in a database, create a link
to it.

$Query = "select DirFilePath from FileDatabase where
imagename='ImageName.jpg'";
$db = $chk->query($Query);
.....db error glue stuff here.
$info = $chk->fetchrow();

for ease of use, combine your DirFilePath with ImageName.jpg
( /usr/local/images/imagename.jpg ) or something like that.
<img src="/usr/local/images/imagename.jpg">
..... more html/php code here.

your results may vary!

[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

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