<?php

  include_once(dirname(__DIR__).'/classes/partdatabase.class.php');

  $_GET += array("id" => null);

  $fp = $pdb->Footprints()->GetById($_GET["id"]);

  $json = json_encode($fp, JSON_PRETTY_PRINT);

  // Clear buffer and print JSON
  ob_clean();

  echo $json;
?>

<?php

  include_once(dirname(__DIR__).'/classes/partdatabase.class.php');

  $_GET += array("id" => null);

  $data = array_replace_recursive( array("id" => null), $_GET, $_POST );

  $fp = $pdb->Footprints()->GetById($data["id"]);

  $json = json_encode($fp, JSON_PRETTY_PRINT);

  // Clear buffer and print JSON
  ob_clean();

  echo $json;
?>

Use $_POST $_GET and defaults
Use $_POST $_GET and defaults
