Ejemplo n.º 1
0
 * Author: Andrew Nelson
 * Processes the input from home.html
 */
$action = $_POST["operation"];
if ($action != null && $action != "") {
    if ($action == "generate") {
        $fileName = $_POST["saveFile"];
        $runs = $_POST["runs"];
        if ($fileName != null && $fileName != "") {
            echo "Generating Your Results. Please be Patient<br />";
            ob_flush();
            flush();
            include "results.php";
            $result = new Results();
            $result->runTests($runs);
            $result->writeXML($fileName);
            echo "Your file has been saved to {$fileName}<br />";
            echo "<a href = 'home.php'>Run the Tool Again</a><br />";
            return;
        } else {
            echo "You must input a file name!<br />";
        }
    }
    if ($action == "compare") {
        $fileOne = $_POST["firstFile"];
        $fileTwo = $_POST["secondFile"];
        if ($fileOne != null && $fileOne != "" && $fileTwo != null && $fileTwo != "") {
            if (!file_exists($fileOne)) {
                echo "The first specified file doesn't exist<br/>";
                echo "<a href = 'home.php'>Run the Tool Again</a><br />";
                return;