You are here: Re: Display pictures corresponding to database entry. « All PHP « IT news, forums, messages
Re: Display pictures corresponding to database entry.

Posted by Martin Jay on 05/15/06 18:46

In message <CP%9g.48253$MM6.35416@bignews3.bellsouth.net>, Richard Heinz
<richardkheinz@bellsouth.net> writes
>I have a directory of pictures of individuals and a database with the
>individual information. One filed or column in the database has the
>location (directory/filename) of picture. I display the personal
>information form the database in a table amd now want to display the
>corresponding picture with the individual information in the table.
>
>This is the page with the indiviual info without the pictures.
>
>http://sadcma.com/Missions/DistrictMissionary.php

Try inserting the following where you want the picture to be display:


<?php
$image = ; // image location and filename
$name = ; // name of person

$size=getimagesize($image); // set the dimensions of image
?>

<img src="<?php echo $image; ?>" alt="<?php echo $name;?>" <?php echo
$size[3]; ?>">


$image is the directory/filename from your database, and $name is the
name of the person.

And finally $size=getimagesize($image); returns an array of information
about the image. $size[3]; should contain it's dimensions in a format
such as:

width="" height=""

--
Martin Jay

 

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

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