Example #1
0
} elseif ($act == "editUser") {
    $mes = editUser($id);
} elseif ($act == "waterText") {
    $mes = doWaterText($id);
} elseif ($act == "waterPic") {
    $mes = doWaterPic($id);
} elseif ($act == "addGuest") {
    $mes = addGuest();
} elseif ($act == "addGuestInfo") {
    $mes = addGuestInfo();
} elseif ($act == "editGuestInfo") {
    $mes = editGuestInfo($id);
} elseif ($act == "editGuestRequest") {
    $mes = editGuestRequest($id);
} elseif ($act == "delGuest") {
    $mes = delGuest($id);
} elseif ($act == "delImg") {
    $mes = delImg($album_id, $img_path);
} elseif ($act == "addImgs") {
    $mes = addImgs($album_id);
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<?php 
Example #2
0
    $name = htmlspecialchars(@$_POST['name'], ENT_HTML5, 'utf-8');
    $age = htmlspecialchars(@$_POST['age'], ENT_HTML5, 'utf-8');
    $gender = htmlspecialchars(@$_POST['gender'], ENT_HTML5, 'utf-8');
    $email = htmlspecialchars(@$_POST['email'], ENT_HTML5, 'utf-8');
    $code = addGuest($mysqli, $name, $age, $gender, $email);
    if ($code != -1) {
        report($code, "OK");
    } else {
        report(-1, "Internal server error.");
    }
} else {
    if ($action == "delguest") {
        $gid_array = $_REQUEST['guests'];
        $flag = 0;
        foreach ($gid_array as $gid) {
            $code = delGuest($mysqli, $gid);
            if ($code == 1) {
                report(1, "One of the guests you have attempted to delete is not in the database. Please refresh your page. If this happens again, please contact Big Green Snake and report this incident.");
                $flag = 1;
                break;
            } else {
                if ($code == 2) {
                    report(2, "Internal server error.");
                    $flag = 1;
                    break;
                }
            }
        }
        if ($flag == 0) {
            report(0, "OK");
        }