On Jul 1, 10:56 am, prashant <prashant.kalya nra...@gmail.co mwrote:
On Jul 1, 3:45 am, Jerry Stuckle <jstuck...@attg lobal.netwrote:
Jerry Stuckle wrote:
Geoff Berrow wrote:
>Message-ID: <g4c9dn$7a...@r egistered.motza rella.orgfrom Jerry Stuckle
>contained the following:
>>OK, I guess I don't understand just what you're trying to do then.
>>when you do
>>echo 'ref="link.php? id='.$row['id'] . '"';
>>You should get on your page (see the page source!)
>> ref="link.php?i d=42"
>>if $row['id'] is 42. Are you not getting this?
>Perhaps he wants :
><a href="link.php? id=<?php echo $row['id']; ?>">more info</a>
Coule be, Jeff. I wish I knew. The code he has doesn't make a lot of
sense.
Sorry, I mean Geoff...
Too early in the morning :-)
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attgl obal.net
=============== ===
Thank you for all your help but i am still stuck
sorry for not being clearer. the error is jus b4 county. i want to
display the output in xml form.
the output i get is
XML Parsing Error: not well-formed
Location:http://localhost/pra/newphpgend.php
Line Number 1, Column 119:<markers><m arker name="Newark, Memorial,
High" street="39375 Cedar Blvd." city="Newark" zip="94560"
ref="link.php?i d=1"county="Ala meda"
once agian my line of code is echo 'ref="link.php? id='.$row['id'] .
'"';
I am using php to generate ouput in xml form using mysql as my
database.Then i am calling the xml output in my html page(this html
page is for google maps).Every school present in my xml file is
displayed in the form of markers in google map. when clicked on a
marker it displays lat,long,distri ct,county etc. I would also like to
have a link for every school i display on the map.initially i tried
making static pages and static links but it was too tedious. so i
created a page link.php which takes in id and displays the information
about school.
The dynamic link on either the php page or html page. i am trying to
make small changes to my php page to make it work since i wasnt able
to do it on tht html page.
so the code i wrote on my phph page is
echo '<markers>';
// Iterate through the rows, printing XML nodes for each
while ($row = @mysql_fetch_as soc($result)){
// ADD TO XML DOCUMENT NODE
echo '<marker ';
echo 'name="' . $row['name'] . '" ';
echo 'street="' . $row['street'] . '" ';
echo 'city="' . $row['city'] . '" ';
echo 'zip="' . $row['zip'] . '" ';
echo 'ref="link.php? id='.$row['id'] . '"';
echo 'county="' . $row['county'] . '" ';
echo 'earthquake="' . $row['earthquake'] . '" ';
echo 'lat="' . $row['lat'] . '" ';
echo 'lng="' . $row['lng'] . '" ';
echo 'type="' . $row['type'] . '" ';
echo '/>';
}
// End XML file
echo '</markers>';
?>
with other corresponding information on top.without the echo ref my
code works perfectly fine.
on my html page the imprtant functions i am using are
function load() {
if (GBrowserIsComp atible()) {
var map = new GMap2(document. getElementById( "map"));
map.addControl( new GSmallMapContro l());
map.addControl( new GMapTypeControl ());
map.setCenter(n ew GLatLng(37.6184 12, -122.041893), 10);
GDownloadUrl("n ewphpgen.php", function(data) {
var xml = GXml.parse(data );
var markers =
xml.documentEle ment.getElement sByTagName("mar ker");
for (var i = 0; i < markers.length; i++) {
var name = markers[i].getAttribute(" name");
var street = markers[i].getAttribute(" street");
var type = markers[i].getAttribute(" type");
var city = markers[i].getAttribute(" city");
var zip = markers[i].getAttribute(" zip");
var earthquake = markers[i].getAttribute(" earthquake");
var link = markers[i].getAttribute(" link");
var linkss = markers[i].getAttribute(" linkss");
var point = new
GLatLng(parseFl oat(markers[i].getAttribute(" lat")),
parseFloat(mark ers[i].getAttribute(" lng")));
var marker = createMarker(po int, name, type,link, linkss,
city, zip, street, earthquake);
map.addOverlay( marker);
map.setMapType( G_HYBRID_TYPE);
}
function createMarker(po int, name, type,link, linkss, city, zip,
street, earthquake) {
var marker = new GMarker(point, customIcons[type]);
//var html = "<b>" + name +"<br/></b>" + street + "<br/>"+ city
+" " + zip +"<br/><b>Earthquak e: " + earthquake + "</b><br/><a
href="+link+">" +"more info"+ "</a>";
currently i am suing static link to schools but now i hav a databse of
15000 records and making a link for every field would not be feasible.
can u please tell me what would be the best solution