Forum Moderators: coopster

Message Too Old, No Replies

Strange getfile problem

Shows border around image

         

casey133

11:13 pm on Feb 2, 2006 (gmt 0)

10+ Year Member



I am just starting PHP and have a problem already (of course :) ... here is the problem:

Lets say I have index.php and another page (sidenav.html)

i want to have the same side buttons on all pages but I dont want to go through each page changing a link, so I placed the content on the sidenav.html page and used the "readfile "sidenav.html" tag within the index.php file.

At this point everything works great, here is where the problems start.

When I go back to sidenav.html and place a link on an image, then preview index.php in a browser, I see a border around that image.

Should I be using another tag for doing this, should sidenav.html be sidevan.php? Any advice at all would be great.

Thanks

StupidScript

11:28 pm on Feb 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Perhaps use
include "sidenav.html";
instead of
readfile
, as a quick suggestion ... less strain on your computer.

Look to the .html page for the answer to your border question. It is in that code that you need to disable the border:

<img src="link.gif" border=0 ...

By default, images that are links will have a border around them.

casey133

12:09 am on Feb 3, 2006 (gmt 0)

10+ Year Member



Thanks for the reply. I used include "sidenav.html"; but still see a border.

I check sidenav.html but did not see a border tag at all. Here is a ta taken from sidenav.html... notice no image border.

<td height="21" valign="top"><a href="http://www.siteurl.com" target="_blank"><img src="images/link1.gif" width="194" height="21" /></a></td>

I am using Dreamweaver 8.01

StupidScript

12:11 am on Feb 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There isn't any border 'tag', it's an 'attribute' of the IMG tag. Here's your fix:

<img src="images/link1.gif" [b]border=0[/b] width="194" height="21" />

Although it is up to the browser, IFAIK all browsers will put a border around a linked image automatically unless you instruct them not to by adding the 'border' attribute as noted or some CSS equivalent. The value of the 'border' attribute refers to how many pixels wide the border should be. In your case, "no pixels wide, please".

casey133

12:21 am on Feb 3, 2006 (gmt 0)

10+ Year Member



That worked great, thanks for the quick help!

StupidScript

12:37 am on Feb 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You bet!

And I'm thinking ... 'border' may be called a 'property' of the IMG tag instead of an 'attribute' ... so find out before you go spreading it around ...!