예제 #1
0
        $headers = "MIME-Version: 1.0" . "\r\n";
        $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
        $headers .= 'From: <*****@*****.**>' . "\r\n";
        mail($to, $subject, $message, $headers);
        return true;
    }
    function rnd()
    {
        $my_array = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "W", "X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
        $auto = '';
        for ($i = 0; $i <= 9; $i++) {
            $random = array_rand($my_array);
            $auto .= $my_array[$random];
            unset($my_array[$random]);
        }
        return $auto;
    }
    $cleanDate = substr($_POST['Sdate'], -10);
    $daterev = new DateTime($cleanDate);
    $datenow = new DateTime("now");
    if ($datenow >= $daterev) {
        header('location:../index.php?err=jsdaggk');
        exit;
    } else {
        if (exe_reserve($_POST['Sched'], $_POST['Sdate'], $_POST['Tickets'])) {
            header('location:../profile.php');
        } else {
            header('location:../index.php');
        }
    }
}
예제 #2
0
    if (!mysql_query($sql)) {
        die(mysql_error());
    } else {
        return true;
    }
}
function rnd()
{
    $my_array = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "W", "X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
    $auto = '';
    for ($i = 0; $i <= 9; $i++) {
        $random = array_rand($my_array);
        $auto .= $my_array[$random];
        unset($my_array[$random]);
    }
    return $auto;
}
if ($_POST['Rdate'] == '') {
    header('location:../reservationDetails.php');
} else {
    if ($_POST['Submit'] == 'Book It') {
        //die(var_dump($_POST));
        if (exe_reserve($_POST['Sched'], $_POST['Rdate'])) {
            echo "Reservation is successfull<br>";
            echo 'Redirecting...';
            header('Refresh:2 ; URL=../profile.php');
        }
    } else {
        header('location:../reservati0n.php');
    }
}