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