Jump to content

Image alongside a link?? **Solved**


Round

Recommended Posts

Hello all,
I have an image that I want to display next to a link. I can't seem to get it to sit next to the link, it keeps displaying the image above the link.

I can put the image as part of the link, which means they will display alongside one another, but I don't want this as it puts a box around the image to show that it is a link.

How do I solve this? Heres what I have so far:-
Which displays the image above the link.

[code]<?php
#connect to db
$conn = @mysql_connect(  "localhost", "dbusername", "dbpassword" )
      or die( "Err:conn");
#select db
$rs = @mysql_select_db( "dbname", $conn)
or die( "ERR:Db");

#create query
$sql = "Select * from course where userid = \"$userid\" ";

#exe query
$rs = mysql_query( $sql, $conn )
or die( "Could not execute Query");

while( $row = mysql_fetch_array($rs) )
{
$list .="<img src=\"../images/list_course.gif\">";
$list .="<a href=\"http://ourweb/course/category.php?id=".$row["course"]."\">".$row["fullname"]."</a>";

}
echo( $list );

?>[/code]

Even the following makes the image dispaly above link:-

[code]while( $row = mysql_fetch_array($rs) )
{
$list .="<img src=\"../images/list_course.gif\"><a href=\"http://ourweb/course/category.php?
id=".$row["course"]."\">".$row["fullname"]."</a>";

}[/code]


The following puts link box around image (ugly) but do display alongside each other:-

[code]while( $row = mysql_fetch_array($rs) )
{
$list .="<a href=\"http://ourweb/course/category.php?id=".$row["course"]."\"><img
src=\"../images/list_course.gif\">".$row["fullname"]."</a>";

}[/code]

Any Ideas?

Many Thanks
Link to comment
https://forums.phpfreaks.com/topic/26433-image-alongside-a-link-solved/
Share on other sites

[quote author=Round link=topic=114121.msg464182#msg464182 date=1162899823]
The following puts link box around image (ugly) but do display alongside each other:-

[code]while( $row = mysql_fetch_array($rs) )
{
$list .="<a href=\"http://ourweb/course/category.php?id=".$row["course"]."\"><img
src=\"../images/list_course.gif\">".$row["fullname"]."</a>";

}[/code]

Any Ideas?

Many Thanks

[/quote]

To get around this one you could check out this:
http://www.boutell.com/newfaq/creating/border.html

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.