application macrodroid envoi de coordonnée GPS fichier PHP
Bonjour à tous,
Je souhaiterai envoyer ma position gps via l'application macrodroid dans un dichier PHP pour l'afficher dans un post WordPress.
voici le code qui me parait correct mais n'affiche rien. Je pensais au départ à un problème lié à la cré api mais non elle fonctionne bien. Merci d'avance pour votre aide.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| <?php
/**
* WordPress User Page
*
* Handles authentication, registering, resetting passwords, forgot password,
* and other user handling.
*
* @package WordPress
*/
/** Make sure that the WordPress bootstrap has run before continuing. */
require( dirname(__FILE__) . '/wp-load.php' );
global $wpdb;
$my_post = array(
'ID' => 1,
'post_title' => 'This is the post title.',
'post_content' => '<script>alert("test2")</script>',
);
// Update the post into the database
var_dump( $wpdb->update( 'wp_posts', array ( 'post_content' => '<div id="map" style="height:500px;width:500px"></div>
<script>// <![CDATA[
function initMap() { var myLatLng = {lat: ' . $_GET["latitude"] . ', lng: ' . $_GET["longitude"] . '}; var map = new google.maps.Map(document.getElementById(\'map\'), { zoom: 15, center: myLatLng }); var marker = new google.maps.Marker({ position: myLatLng, map: map, title: \'Hello World!\' }); }
// ]]></script>
<script src="https://maps.googleapis.com/maps/api/js?key={API-KEY}&signed_in=true&callback=initMap" async="" defer="defer"></script>' ), array ( 'ID' => {ID_POST}), $format = null, $where_format = null ));
?> |