
<script type='text/javascript'>
var address = '$adresse';
geocoder = new google.maps.Geocoder();
geocoder.geocode({ 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var latitude_adresse = results[0].geometry.location.lat();
var longitude_adresse = results[0].geometry.location.lng();
$(document).ready(function() {
$(function(){
$.ajax({
type: 'POST',
data: {'user_id':$user_id,'user_lat':latitude_adresse,'user_lng':longitude_adresse},
url: 'http://horse-evolu.com/wp-content/themes/classipress-labzip/update_profile_latlng.php'
});
});
});
}
});
</script>
<?php
$path = $_SERVER['DOCUMENT_ROOT'];
include_once $path . '/wp-config.php';
include_once $path . '/wp-load.php';
include_once $path . '/wp-includes/wp-db.php';
include_once $path . '/wp-includes/pluggable.php';
global $wpdb;
global $current_user;
$user_id = $_POST['user_id'] ;
$wpdb->update('wp_users', array("user_lat" => $_POST['user_lat']),array('ID' => $_POST['user_id']));
$wpdb->update('wp_users', array("user_lng" => $_POST['user_lng']),array('ID' => $_POST['user_id']));
?>

There are currently 1 users browsing this thread. (0 members and 1 guests)