<?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;
?>

<?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;
?>

--- 
+++ 
@@ -4,7 +4,9 @@
 
   $_GET += array("id" => null);
 
-  $fp = $pdb->Footprints()->GetById($_GET["id"]);
+  $data = array_replace_recursive( array("id" => null), $_GET, $_POST );
+
+  $fp = $pdb->Footprints()->GetById($data["id"]);
 
   $json = json_encode($fp, JSON_PRETTY_PRINT);
 
Use $_POST $_GET and defaults
