ShaolinF Posted July 29, 2007 Share Posted July 29, 2007 Hi guys, I want to put borders around my php made images. Here is the code: <?php // Change this to the total number of images in the folder $total = "3"; // Change to the type of files to use eg. .jpg or .gif $file_type = ".jpg"; // Change to the location of the folder containing the images $image_folder = "images"; // You do not need to edit below this line $start = "1"; $random = mt_rand($start, $total); $image_name = $random . $file_type; echo "<img src=\"$image_folder/$image_name\" alt=\"$image_name\" />"; ?> Link to comment https://forums.phpfreaks.com/topic/62311-border-around-php-images/ Share on other sites More sharing options...
AndyB Posted July 29, 2007 Share Posted July 29, 2007 html ... echo "<img src=\"$image_folder/$image_name\" alt=\"$image_name\" border=\"1\"/>"; Link to comment https://forums.phpfreaks.com/topic/62311-border-around-php-images/#findComment-310069 Share on other sites More sharing options...
ShaolinF Posted July 29, 2007 Author Share Posted July 29, 2007 Thanks, that worked. How about if I want to change the color of the border to a greyish color ? What code will I need ? Link to comment https://forums.phpfreaks.com/topic/62311-border-around-php-images/#findComment-310089 Share on other sites More sharing options...
zipp Posted July 31, 2007 Share Posted July 31, 2007 echo "<img src=\"$image_folder/$image_name\" alt=\"$image_name\" border=\"1\" bordercolor=\"grey\" />"; or with css echo "<img src=\"$image_folder/$image_name\" alt=\"$image_name\" border=\"1\" style=\"border: solid grey;\" />"; Link to comment https://forums.phpfreaks.com/topic/62311-border-around-php-images/#findComment-311731 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.