distancefinder/save-location1.php

21 lines
400 B
PHP
Raw Normal View History

<?php
require_once 'bootstrap.php';
$id = dbGetVal("select id from df_locations where address='".dbEscape($_POST['location']['adr'])."'");
if($id){
echo $id;
exit;
}
dbInsert('df_locations', array(
'address' => formatAddress($_POST['location']['adr']),
'latitude' => $_POST['location']['lat'],
'longitude' => $_POST['location']['lng'],
));
echo dbGetInsertId();