<!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>无标题文档</title> </head> <body> <h1>修改地图信息</h1> <?php $id = $_GET["id"]; = new MySQLi("localhost","root","726","ziyuan"); = "select * from ditu where"; =$db->query($sql); = $result->fetch_row(); ?> <form action="baiduxgcl.php" method="post"> <div>地 址:<input type="text" disabled="disabled" value="<?php echo $attr[1] ?>"/></div> <br /> <input type="hidden" value="<?php echo $attr[0] ?>"/> <div>标 题:<input type="text" value="<?php echo $attr[3] ?>"/></div> <br /> <div>电 话:<input type="text" value="<?php echo $attr[4] ?>"/></div> <br /> <div><input type="submit" value="修改" /></div> </form> </body> </html>
修改处理代码
<?php $id = $_POST["id"]; $biaoti = $_POST["biaoti"]; $tem = $_POST["tem"]; = new MySQLi("localhost","root","726","ziyuan"); = "update ditu set biaoti='{$biaoti}',tem='{$tem}' where"; =$db->query($sql); if($r) { header("location:baiduht.php"); } else { echo "修改失败!"; }
最后就是删除部分代码
<?php $id= $_GET["id"]; = new MySQLi("localhost","qishuang","qishuang","qishuang"); = "delete from ditu where"; =$db->query($sql); if($r) { header("location:baiduht.php"); } else { echo "删除失败!"; }
这样一整个就做完了
-----------------------------------------------------------------------------------
还有一种功能,就是输入地址可以读出他的经纬度,然后从地图上立马找到
这个功能不跟大家细说了,下面我把源代码写下面
根据地址查询经纬度 要查询的地址: 查询结果(经纬度): style="position: absolute; margin-top:30px; width: 730px; height: 590px; top: 50; border: 1px solid gray; overflow:hidden;"); map.centerAndZoom(); map.enableScrollWheelZoom(); map.addControl( BMap.LocalSearch(map); localSearch.enableAutoViewport(); searchByStationName() { map.clearOverlays();).value; localSearch.setSearchCompleteCallback(function (searchResult) { ); document.getElementById( poi.point.lat; map.centerAndZoom(poi.point, 13); map.addOverlay(marker); poi.point.lat; ); marker.addEventListener(.openInfoWindow(infoWindow); }); // marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画 }); localSearch.search(keyword); }
运行起来的话就是这种效果