Coding help

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I've now got a form that will output to a MySql database as you can
see here.

Obviously the graphical look needs work.

I am then using a little php to read those to create this

using this code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns=" ">
<title>Who locations in London</title>
<script src="
<p><strong>Windsurfing Spots, Shops, Webcams and windsurfers</
<div id="map" style="width: 500px; height: 400px"></div>

<script type="text/javascript">

var map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.addControl(new GScaleControl());
map.setCenter(new GLatLng(54.512161, -1.17523), 5, G_NORMAL_MAP);

// Creates a marker whose info window displays the given number
function createMarker(point, number)
var marker = new GMarker(point);
// Show this markers index in the info window when it is clicked
var html = number;
GEvent.addListener(marker, "click", function()
return marker;


$link = mysql_connect("localhost", "[Username]", "[password]") or
die("Could not connect: " . mysql_error());
mysql_selectdb("[dbname]",$link) or die ("Can't use dbmapserver :
" .

$result = mysql_query("SELECT * FROM locations",$link);
if (!$result)
echo "no results ";


while($row = mysql_fetch_array($result))
echo "var point = new GLatLng(" . $row['field_10'] . "," .
$row['field_9'] . ");\n";
echo "var marker = createMarker(point, '" .
addslashes($row['field_1']) . "<b>" . $row['field_2'] . " </b><b>" .
$row['field_3'] . " </b><p>" . $row['field_4'] . " </p><p>" .
$row['field_4'] . " </p><p>" . $row['field_6'] . " </p><p>" .
$row['field_7'] . " </p><p>" . $row['field_8'] . " </p><p>" .
$row['field_11'] . " </p><p>" . $row['field_12'] . " </p>');\n";
echo "map.addOverlay(marker);\n";
echo "\n";





I'm just having a little trouble with the finishing touches.

The simple ones first.

1) What do I use instead of the <p> </p> tags to designate a new line
without a space?

2) I need this field . $row['field_11'] . to work as a link but I'm
not sure how to do it.

and now for the hard bit

3) Field 1 can be one of 5 items from a drop down. I would like the
map to have a different custom icon for each one of the selections.

I'm sure all this can be achieved but I'n very new to coding so am
struggling a bit.

Re: Coding help wrote:
Quoted text here. Click to load it
<br />
Quoted text here. Click to load it
<a href=\"$row['field_11']"> whatever text you want </a>
Quoted text here. Click to load it

I do not understand what you want to do.
Quoted text here. Click to load it


Site Timeline