public function changeItemQuantity($row, $quan)
 {
     if (!lib_int_validate($quan)) {
         die("ERROR ON PAGE");
     } else {
         $i = lib_parseInteger($row);
         if ($this->itemArr[$i]["quantity"] == $quan) {
             return;
         } else {
             if ($quan == 0) {
                 $this->deleteItem($this->itemArr[$i]["cid"]);
                 return;
             } else {
                 if ($quan > 0) {
                     $this->changeQuantity($this->itemArr[$i]["cid"], $quan);
                 }
             }
         }
     }
 }
Example #2
0
//check username input validation:
if (!cn_name_input_validate($usr)) {
    die("<h3>Error page!</h3>");
}
//check password input validation:
if (!lib_psw_validate($psw)) {
    die("<h3>Error page!</h3>");
}
if (!lib_email_validate($E_mail)) {
    die("<h3>Error page!</h3>");
}
//check if name is avalable:
if (isUserExist($usr, $psw)) {
    die("<h3>Error page!</h3>");
}
if (!lib_parseInteger($code)) {
    die("<h3>Error page!</h3>");
}
if (!lib_vertifyCode_validate($code)) {
    echo $_COOKIE['verification_string'];
    die("<h3>Error page!</h3>");
}
//register user on the system
$vcode = "bz" . rand() . "cmcbk" . rand() . "str" . rand() . "fk" . rand() . "vc" . rand();
insertNewUser($usr, $psw, $E_mail, $vcode);
//email register for the vertify purpose
$to = $E_mail;
$subject = "BZ漫畫屋驗證 ";
$body = "你好,感謝您註冊帳號, {$usr} !\n\n\t\t請點擊以下連接去激活你的帳號:\n\n\t\t{$glob_domain}/process/prcs.email_vertification.php?fh4h34fstjzh={$vcode}";
if (mail($to, $subject, $body)) {
    header("Location:../signup2.php");