Contenidos
Código en PHP que almacena cuatro valores
1 2 3 4 5 |
<?php $fh = fopen("valores.txt", 'a') or die("Se produjo un error al crear el archivo"); fwrite($fh, htmlentities($_POST['longitude']) . '|' . htmlentities($_POST['latitude']) . '|' . htmlentities($_POST['altitude']) . '|' . htmlentities($_POST['speed']) . PHP_EOL) or die("No se pudo escribir en el archivo"); fclose($fh); ?> |
Comprobar que se almacenan los valores (latitud, longitud, altitud y velocidad), haciendo una petición POST desde un script en PowerShell
1 2 |
$postParams = @{latitude="47";longitude="4";altitude="200";speed="300"} $web=Invoke-WebRequest -Uri 'https://www.jesusninoc.com/datos.php' -Method Post -Body $postParams |