Hi all .
I am having problems with this script.
Firstly I do have a filed in my database named "pic" in this field I have the name of a graphic file "lord_leycester.gif"
Now for the script.
<?php require_once('Connections/accomm.php'); ?>
<?php
$image_path = 'http://www.travellingtoengland.co.uk/recreation/images/attract/';
$colname_attactions = "1";
if (isset($_GET['id'])) {
$colname_attactions = (get_magic_quotes_gpc()) ? $_GET['id'] : addslashes($_GET['id']);
}
mysql_select_db($database_accomm, $accomm);
$query_attactions = sprintf("SELECT * FROM travel_attractions WHERE id = %s", $colname_attactions);
$attactions = mysql_query($query_attactions, $accomm) or die(mysql_error());
$row_attactions = mysql_fetch_assoc($attactions);
$totalRows_attactions = mysql_num_rows($attactions);
$name = $row_attactions['name'];
$address1 = $row_attactions['address1'];
$address2 = $row_attactions['address2'];
$address3 = $row_attactions['address3'];
$address4 = $row_attactions['address4'];
$address5 = $row_attactions['address5'];
$tel = $row_attactions['tel'];
$pic = '<img src="'.$image_path.$row_attractions['pic'].'" />';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="http://maps.google.com/maps?file=api&v=1&key=ABQIAAAADpKgOosNgr57RkhGYrYcfxQyxqJmZNebgnEglKno7xM4XmTrXRSa3rgcPPdcQoDkb0hiEjQLf-0_JQ" type="text/javascript"></script>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body leftmargin="0" topmargin="0" onblur="self.focus();">
<div id="map" style="width: 500px; height: 400px"></div>
<script type="text/javascript">
//<![CDATA[
var WINDOW_HTML = '<table><tr><td><div class="bodytextsmall"><?php echo "$name <br /> $address1 <br /> $address3 <br /> $address4 <br /> $tel </td><td> </td><td> $pic" ?> <br /></td><td><img src="recreation/images/attract/lord_leycester.gif" </ div></td></tr></table>';
function loadMap() {
var map = new GMap(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.centerAndZoom(new GPoint(<?php echo $_GET['lon']?>, <?php echo $_GET['lat']?>), 2);
var marker = new GMarker(new GPoint(<?php echo $_GET['lon']?>, <?php echo $_GET['lat']?>));
var icon = new GIcon();
icon.image = "http://www.google.com/mapfiles/marker.png";
icon.shadow = "http://www.google.com/mapfiles/shadow50.png";
icon.iconSize = new GSize(20, 34);
icon.shadowSize = new GSize(37, 34);
map.addOverlay(marker);
GEvent.addListener(marker, 'click', function() {
marker.openInfoWindowHtml(WINDOW_HTML);
});
marker.openInfoWindowHtml(WINDOW_HTML);
}
loadMap();
//]]>
</script>
</body>
</html>
<?php
mysql_free_result($attactions);
?>
This script displays a map with an info window which displays the conent of my variables.
All the variables show there conent except for the pic var. If I run the script with the path and the name of the grahpic file in the "var WINDOW_HTML" the result is I get a grahpic holder where the $pic var should display the content and I get the graphic file displayed from the image path.
This works | <img src="recreation/images/attract/lord_leycester.gif">
This does not | <?php echo "$pic" ?>
Is there anyone that can put some light on this.