IE8 doesn't know how to handle image link
Posted: Mon Aug 17, 2009 6:42 am
Here's the way I'm displaying some images. All images with a common attribute get displayed in a table with proplist.php. If you click one of them it opens full size. The image is generated by viewprop.php. It works in ff, but ie doesn't know what to do with the image link and asks if you want to save it or find a program online to open it. Here's the code:
proplist.php
viewprop.php
Any help is greatly appreciated.
proplist.php
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Luxury Maui Property</title>
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.3/prototype.js'></script>
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.2/scriptaculous.js'></script>
<script type='text/javascript' src='js/lightview.js'></script>
<link rel="stylesheet" href="css/lightview.css" type="text/css" media="screen" title="no title" charset="utf-8" />
</head>
<body>
<?php
include '../lmp_includes/lmp_utilities.php';
$db = db_connect();
if ($_GET['mls']) {
$mls = mysql_real_escape_string($_GET['mls']); //these five get the propID
$q = "select propID from properties where mls = $mls";
$r = mysql_query($q);
$d = mysql_fetch_object($r);
$id = $d->propID;
$q = "select * from images where propID = $id"; //these three lines get num rows
$r = mysql_query($q);
$numImages = mysql_num_rows($r);
$d = mysql_fetch_assoc($r);
echo "<table><td>";
for ($i = 0; $i < $numImages; $i++) {
if (($i!=0) && !($i%4)) {
echo "</td><tr></tr><td>";
}
echo "<a href=\"viewprop.php?mls=$mls&offset=$i\"><img src=\"viewprop.php?mls=$mls&offset=$i\" height=\"150px\" width=\"200px\"/></a>";
}
echo "</td></table>";
} else {
echo "I need an ID.";
}
?>
</body>
</html>
Code: Select all
<?php
include '../lmp_includes/lmp_utilities.php';
$db = db_connect();
if ($_GET['mls'] || $_GET['offset']) {
$mls = mysql_real_escape_string($_GET['mls']);
$offset = mysql_real_escape_string($_GET['offset']);
$q = "select propID from properties where mls = $mls";
$r = mysql_query($q);
$d = mysql_fetch_object($r);
$id = $d->propID;
header('Content-type: image/jpg');
$q = "select * from images where propID = $id limit $offset, 1";
$r = mysql_query($q);
$d = mysql_fetch_object($r);
echo $d->image;
} else {
echo "I need both an mls and an offset.";
}
?>