hance2105 Posted June 21, 2013 Share Posted June 21, 2013 i have the below code and want to know how to specify the height and width of the photo that is being displayed <div class="product_img"><a href=""><?= '<img src="Images/Products/'.$row['prod_photo'].'"/>'; ?></a></div> thanks for the help Quote Link to comment https://forums.phpfreaks.com/topic/279430-setting-picture-height-and-width/ Share on other sites More sharing options...
litebearer Posted June 21, 2013 Share Posted June 21, 2013 This may help http://php.net/manual/en/function.getimagesize.php Quote Link to comment https://forums.phpfreaks.com/topic/279430-setting-picture-height-and-width/#findComment-1437263 Share on other sites More sharing options...
hance2105 Posted June 21, 2013 Author Share Posted June 21, 2013 in fact what i need is to set the specific height and width in the code provided, meaning i already define it so that when retrieved the image is displayed in that size Quote Link to comment https://forums.phpfreaks.com/topic/279430-setting-picture-height-and-width/#findComment-1437264 Share on other sites More sharing options...
Solution richei Posted June 21, 2013 Solution Share Posted June 21, 2013 the img tag has height and width attributes <?= '<img src="Images/Products/$row['prod_photo']" height="$img_height" width="$img_width" />'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/279430-setting-picture-height-and-width/#findComment-1437272 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.