当前位置: 首页>>代码示例>>PHP>>正文


PHP WebPage::showError方法代码示例

本文整理汇总了PHP中WebPage::showError方法的典型用法代码示例。如果您正苦于以下问题:PHP WebPage::showError方法的具体用法?PHP WebPage::showError怎么用?PHP WebPage::showError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WebPage的用法示例。


在下文中一共展示了WebPage::showError方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: explode

        $message->setSubject($subject);
        $message->setBody($body);
        $message->setFrom($entrantObj->email, $entrantObj->email);
        $message->setContentType("text/html");
        $mailer = Swift_Mailer::newInstance($transport);
        if ($sendMail) {
            $mailer->send($message);
        }
        //Send Email to the invitee
        if ($returnAction == 'success') {
            $cfg->infoMessage = "Contest successfully entered and invitation sent. Your current total point is: {$entrantObj->point}.";
        } else {
            $cfg->infoMessage = '<h3>Contest invitation failed!</h3> <p>Please try again later.</p>';
        }
    } else {
        $cfg->infoMessage = $thisPage->showError($errorArr);
    }
}
//Refered Visitor's Handler
if (filter_input(INPUT_GET, "referer") != NULL && filter_input(INPUT_GET, "invitee") != NULL) {
    $entrantObj->email = Entrant::getSingle($dbObj, 'email', filter_input(INPUT_GET, "referer", FILTER_VALIDATE_INT));
    $entrantObj->friends = filter_input(INPUT_GET, "invitee") ? filter_input(INPUT_GET, "invitee") : "";
    $entrantObj->contest = $thisContestId;
    $friendNamesList = Entrant::getSingle($dbObj, 'names', $entrantObj->email);
    $friendEmailsList = Entrant::getSingle($dbObj, 'friends', $entrantObj->email);
    $friendEmailsArr = explode(",", $friendEmailsList);
    $friendNamesArr = explode(",", $friendNamesList);
    $inviteeName = $friendNamesArr[array_search(trim($entrantObj->friends), $friendEmailsArr)];
    //strrpos($friendNamesList, $friendNamesArr[array_search(trim($entrantObj->friends), $friendEmailsArr)]."[m]");
    if (in_array(trim($entrantObj->friends), $friendEmailsArr) && !strrpos($inviteeName, "[m]")) {
        if ($entrantObj->emailExists() == true) {
开发者ID:Mojolagbe2014,项目名称:mojokalokalo,代码行数:31,代码来源:contest.php

示例2: User

if (filter_input(INPUT_POST, "delete-user") !== NULL) {
    $userToDel = new User();
    //Instantiate user class
    $userToDel->id = filter_input(INPUT_POST, 'hidden-user-id') ? mysqli_real_escape_string($dbObj->connection, filter_input(INPUT_POST, 'hidden-user-id', FILTER_VALIDATE_INT)) : '';
    if (filter_input(INPUT_POST, 'hidden-user-id') === "") {
        array_push($errorArr, "Illegal Operation.");
    }
    //If validated and not empty submit it to database
    if (count($errorArr) < 1) {
        if ($userToDel->delete($dbObj, 'users') === 'success') {
            $msg = $thisPage->messageBox('User successfully deleted.', 'success');
        } else {
            $msg = $thisPage->messageBox('User deletion failed.', 'error');
        }
    } else {
        $msg = $thisPage->showError($errorArr);
    }
}
//Admin Role Changer button click handler
if (filter_input(INPUT_POST, "upgrade-user") !== NULL) {
    if (filter_input(INPUT_POST, 'hidden-user-id') === "") {
        array_push($errorArr, "Illegal operation parameter 1.");
    }
    if (filter_input(INPUT_POST, 'hidden-user-role') === "") {
        array_push($errorArr, "Illegal operation parameter 2.");
    }
    if (count($errorArr) < 1) {
        $postRoleVar = 'Admin';
        //set default role to activate
        if (filter_input(INPUT_POST, 'hidden-user-role') == 'Admin') {
            $postRoleVar = 'Editor';
开发者ID:Mojolagbe2014,项目名称:mojoikede,代码行数:31,代码来源:users.php

示例3: switch

                    array_push($errorArr, "Password Mismatch !!! ");
                    if (filter_input(INPUT_POST, $postVar) == "") {
                        array_push($errorArr, "Please confirm your password. ");
                    }
                }
            default:
                if (filter_input(INPUT_POST, $postVar) == "") {
                    array_push($errorArr, "Please enter a {$postVar} ");
                }
        }
    }
    if (count($errorArr) < 1) {
        $thisUser->password = mysqli_real_escape_string($dbObj->connection, filter_input(INPUT_POST, 'password1'));
        $thisUser->id = $_SESSION['USERID'];
        $newPassword = mysqli_real_escape_string($dbObj->connection, filter_input(INPUT_POST, 'password'));
        switch ($thisUser->changePassword($dbObj, 'users', $newPassword)) {
            case 'success':
                $_SESSION['topmsg'] = $thisPage->messageBox('Password successfully changed.', 'success');
                $thisPage->redirectTo($_SERVER['HTTP_REFERER']);
                break;
            case 'error':
                $_SESSION['topmsg'] = $thisPage->messageBox('Password update failed. Please re-enter your details.', 'error');
                $thisPage->redirectTo($_SERVER['HTTP_REFERER']);
                break;
        }
    } else {
        $_SESSION['topmsg'] = $thisPage->showError($errorArr);
        $thisPage->redirectTo($_SERVER['HTTP_REFERER']);
    }
    //Display error messages
}
开发者ID:Mojolagbe2014,项目名称:mojoikede,代码行数:31,代码来源:change-password.php


注:本文中的WebPage::showError方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。