Ejemplo n.º 1
0
        $file = fopen("data/target.txt", "w");
        fwrite($file, "{$stroke}");
    }
}
$obj = new target();
if (isset($_POST["send"])) {
    $exp = explode(",", $_POST["send"]);
    $arr = array();
    foreach ($exp as $val) {
        $val = trim($val);
        $val = mysql_real_escape_string($val);
        $val = strip_tags($val);
        if ($val != "") {
            $arr[] = $val;
        }
    }
    $stroke = implode(",", $arr);
    $obj->write($stroke);
}
if (isset($_POST["pas"])) {
    $pas = $_POST["pas"];
    $error = "wrong password";
    $secr = file_get_contents('data/omg.txt');
    if ($secr != md5($pas)) {
        header("Location: index.php?er={$error}");
    } else {
        $value = "xxx";
        setcookie("Test5", $value, time() + 3600);
        header("Location: target.php");
    }
}