random image script/yucky blue link border around it!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
irishelysia
Forum Newbie
Posts: 6
Joined: Thu Jun 23, 2005 9:42 am
Location: WV

random image script/yucky blue link border around it!

Post 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;;

?>
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post 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\"/>";
irishelysia
Forum Newbie
Posts: 6
Joined: Thu Jun 23, 2005 9:42 am
Location: WV

Post 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
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

this one was easy.. I wanted to answer it and sound smart :(
Post Reply