I have this script that work with no problems on my XAMPP local host:
<html>
<head>
<title>Gallery</title>
<style type="text/css">
body {
margin: 0 auto;
padding: 0;
width: 500px;
color: #000000;
position: relative;
}
.gallery {
list-style: none;
margin: 0;
padding: 0;
}
.gallery li {
margin: 10px;
padding: 0;
float: left;
width: 120px;
height: 100px;
}
.gallery img {
background: #fff;
border: solid 1px #ccc;
padding: 4px;
width: 110;
height: 90;
}
.gallery a:hover img
{border: 1px solid #0000ff;
position: absolute;
top: 0; left: 0;
width:400;
height:300;
}
</style>
</head>
<body>
<ul class="gallery">
<?php
//header("Content-type: image/jpg;\n");
$db_connect = mysql_connect('localhost', 'Beta_tester', 'alfa1gama2');
if(!$db_connect)
{
die('Не може да се осъществи връзка с базата данни' . mysql_error());
}
mysql_select_db("Beta_tester", $db_connect);
$rs = mysql_query('SELECT * FROM gallery WHERE oferta_id=2');
while($row = mysql_fetch_array($rs))
{
echo '<li><a target="_blank" href="http://mysite/fimage.php?id='.$row['id'].'"><img src='.$row['location'].' alt="image"/></a></li>';
}
?>
</ul>
</body>
</html>
On my local server it’s ok, but when I upload it on the production server i get this output:
Pic1:

It’s not shown very good but this is just an empty block with an icon of broken image.The head(content) is commented – I added it later because I saw a similar problem solved with this, but maybe I’m using it wrong or maybe it’s something else.
Thanks
Leron
Make sure the location of the image (URL) is a valid one. Try to print the image url and try to open in another tab to make sure it’s a valid URL.
Also, pass double-quotes on your image src attribute like: