Page 1 of 1

random image script/yucky blue link border around it!

Posted: Tue Jun 28, 2005 1:17 pm
by irishelysia
hey, im a php newbie so yeaaahh...


I'm using a random image script to rotate images each time you refresh.
It works ok but i'm also using it as a link and I can't figure out how to get rid of the nasty blue border around it.

i think i need to put something in my style sheet but I'm not sure what? I have text decoration=none or whatever in there for the links and also border:0 for the {img] tag but its not in an image tag so it doesnt work. But perhaps theres a php way to do this...?

what should i do? Thanks for your help/suggestions:)

heres the code i have in the index...

Code: Select all

<div style=&quote;position:absolute;left:263px;top:245px;width:100px;height:260px;z-index: 2&quote;>
<a href=&quote;pictures.html&quote; target=&quote;frame&quote;>
 <?php include &quote;randomimage.php&quote;; ?></a> <br></div>

and heres randomimage.php...

Code: Select all

<?php

/*
 * 
 *
 * 
 *
 */ 

// Change this to the total number of images in the folder
$total = &quote;2&quote;;

// Change to the type of files to use eg. .jpg or .gif
$file_type = &quote;.gif&quote;;

// Change to the location of the folder containing the images
$image_folder = &quote;pictures/lil&quote;;

// You do not need to edit below this line

$start = &quote;1&quote;;

$random = mt_rand($start, $total);

$image_name = $random . $file_type;

echo &quote;<img src=\&quote;$image_folder/$image_name\&quote; alt=\&quote;$image_name\&quote; />&quote;;

?>

Posted: Tue Jun 28, 2005 1:24 pm
by Burrito
try adding border="0" to the image tag itself (not in the style):

ex:

Code: Select all

echo "<img src=\"$image_folder/$image_name\" alt=\"$image_name\" border=\"0\"/>";

Posted: Tue Jun 28, 2005 1:39 pm
by irishelysia
worked like a charm. Thanks muchly=)

You guys are fast around here, everytime i post its only a few minutes before someone has the answer! Thanks again;)
--elysia

Posted: Wed Jun 29, 2005 3:34 am
by s.dot
this one was easy.. I wanted to answer it and sound smart :(