Example #1
0
      }
      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;
}
Example #2
0
session_start();
$debug = false;
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);
if (isset($_POST['description'])) {
    if ($debug) {
        echo "stage2";
    }
    stage2($_POST);
} else {
    if ($debug) {
        echo "stage1";
    }
    stage1($_GET);
}
// **********************************************************************
function stage1($_GET)
{
    ?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Work order</title>
    <script type="text/javascript">
    function saveValue(target){
	var stepVal = document.getElementById(target).value;
	alert("Value: " + stepVal);
    }
Example #3
0
        $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;
}
?>