From Info Windows to a Database

39 views
Skip to first unread message

dineshkumar deenadayalan

unread,
Aug 5, 2011, 1:43:45 PM8/5/11
to google-map...@googlegroups.com
hi friends, i am having a problem getting output of the From Info Windows to a Database Saving User-Added Form Data(http://code.google.com/apis/maps/articles/phpsqlinfo.html). i don't understand what goes wrong. if i click on the save&close button, it doesn't do any action and not storing into the database. i am in dire need of help. i am using php and mysql. 

Rossko

unread,
Aug 5, 2011, 3:56:56 PM8/5/11
to Google Maps JavaScript API v3

Bob Torzynski

unread,
Aug 6, 2011, 8:27:21 AM8/6/11
to Google Maps JavaScript API v3
Hi Dinesh,

If you could post a link to what you're working on it would help. This
page: http://gis.zgroks.com/rw2.html does what you're talking about.
(I noticed you posted a test to it, btw). The saveData() function in
this working example is different from the Tutorials, and using
encodeURIComponent() instead of escape() helps if you want to use
International characters. I can share the php if you're interested,
but it's pretty similar to what's cited in the example.

function saveData() {
var name =
encodeURIComponent(document.getElementById("name").value);
var address =
encodeURIComponent(document.getElementById("address").value);
//var address =
escape(document.getElementById("address").value);
var type = document.getElementById("type").value;
var latlng = marker.getPosition();

var url = "addrow.php?name=" + name + "&address=" + address +
"&type=" + type + "&lat=" + latlng.lat() + "&lng=" + latlng.lng();
downloadUrl(url, function(data, responseCode) {
if (responseCode == 200 && data.length <= 1) {
infowindow.close();
location.reload();
}
});
} // end function saveData


On Aug 5, 1:43 pm, dineshkumar deenadayalan <dineshg...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages