|
Posted by Darko on 11/12/07 01:52
On Nov 12, 12:11 am, Voodoo Jai <voodoo...@btinternet.com> wrote:
> I have a dbn of images that I retrieve using SQL statements in
> dreamweaver.
What's "dbn"? Never mind. You have a db.
> I want to get the file name using SQL and then place it into the
> "getimagesize" function and then use this info (FileName, Width,
> Height) to display the image on my web page.
>
For terminology's sake - you don't place anything "into a function".
You call
a function with certain parameters.
> something like this
>
> <td width="620" valign="top">
> <?php
>
> //Assign 2 variables the Files name from the db and the file type
>
> $type = 1;
> $FileName = $row_TestDisplay['menu'];
>
> list($width, $height, $type) = getimagesize($FileName);
> ?>
> <div style="overflow: auto; width: 610px; height: 600px">
> <img src="FileName" width="<?PHP $width ?>" height="<?PHP $height ?>">
>
> </div>
> </td>
Why would you need "width='$width' height='$height'" at all, if $width
and $height
are image dimensions. You only do that when you need to display it
resized. Anyway,
it's a bad (and deprecated) practice to use HTML tags to define
element's style, e.g.
image size. Use CSS rules instead.
> I can only get this to work using the height and width attributes in
> the img tag, how can I do this.
>
So, ... what's the problem? I haven't seen any questions here. "I can
get
this to work... ...how can I do this." (with a full stop at the end of
interrogative).
Are you trying to resize the image from PHP, instead of defining its
dimensions in HTML?
Please try following the general rules of punctuation and being clear
about what you want
to be helped with.
> Many thanks in advance
You're welcome
>
> Voodoo Jai
Regards
Navigation:
[Reply to this message]
|