![Neurótico](http://static.forosdelweb.com/fdwtheme/images/smilies/scared.png)
Tengo el siguiente código, el problema es que el genera el registro en la BD, pero no publica los datos (como unidad, ubicacion y comentario), digo que genera el registro por que efectivamente aumenta en 1 el ID en la BD pero no mete lo que se escribe en el form. Anexo el código a ver en que fallé:
Código PHP:
<?
mysql_connect("localhost","****tt","****");
mysql_select_db("********");
$unidad=$_GET['unidad'];
$ubicacion=$_GET['ubicacion'];
$comentario=$_GET['comentario'];
mysql_query("insert into punto (unidad,ubicacion,comentario) values ('$unidad','$ubicacion','$comentario')");
?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Formularios en Google Maps</title>
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAIIDbl_ciQDacBgo0AqmyUBTP57_sWC09JVsUBjOq_8dmqEYAyhQECq8os4J_NHYLLdNy5_s2IW_4cw" type="text/javascript"></script>
<script src="jquery-1.2.6.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
var mark;
var pointA;
if (GBrowserIsCompatible()) {
var m = $("#map")[0];
if(m) {
var map = new GMap2(m);
// iniciamos el mapa en esta ubicacion, tu puedes ubicarla donde gustes
var start = new GLatLng(63.13450320833446,16.69921875);
// otras configuraciones
var zoomLevel = 5;
map.setCenter(start, zoomLevel);
map.addControl(new GSmallMapControl());
// lectura del archivo markers.xml con jQuery
$.get('markers.xml',function(data) {
$(data).find('marker').each(function(){
var lat = $(this).attr('lat');
var lng = $(this).attr('lng');
var html = $(this).attr('unidad')+"<br />";
html += $(this).attr('ubicacion')+"<br />";
html += $(this).attr('comentario');
var point = new GLatLng(lat,lng);
var marker = new GMarker(point);
map.addOverlay(marker);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
});
});
// EL FORMULARIO
GEvent.addListener(map, 'click', function(overlay, point){
if(mark) {
map.removeOverlay(mark);
}
if(point) {
pointA = new GPoint(point.x, point.y);
mark = new GMarker(pointA);
map.addOverlay(mark);
map.getCenter(point);
var lat = point.y;
var lng = point.x;
var form =
"<form action=\"maps_form.php\" method=\"post\">"+
"<input type=\"hidden\" name=\"lat\" value=\""+lat+"\" />"+
"<input type=\"hidden\" name=\"lng\" value=\""+lng+"\" />"+
"Unidad:<input type=\"text\" name=\"unidad\" value=\"\" /><br />"+
"Ubicación:<input type=\"text\" name=\"ubicacion\" value=\"\" /><br />"+
"Comentarios:<input type=\"text\" name=\"comentario\" value=\"\" /><br />"+
"<input type=\"submit\" name=\"submit\" value=\"save\" />"+
"</form>";
map.openInfoWindowHtml(point,form);
}
});
}
}
});
</script>
</head>
<body>
<div id="map" style="width:1000px;height:600px;"></div>
</body>
</html>
Si tienen idea de por que me sucede esto (Que seguro estoy que es una tontería y solo le pasa a los más principiantes
![borracho](http://static.forosdelweb.com/fdwtheme/images/smilies/borracho.png)
OJO: se que faltan campos, aun no he siquiera hecho el script que genere el XML, solo nesesito este empujon, prometo compartir el script completo al terminarlo, se que hay cientos de personas que les serviría al igual que a mi.