當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserController::AddUser方法代碼示例

本文整理匯總了PHP中UserController::AddUser方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserController::AddUser方法的具體用法?PHP UserController::AddUser怎麽用?PHP UserController::AddUser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UserController的用法示例。


在下文中一共展示了UserController::AddUser方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: header

<?php

if (isset($_POST["btnAddUser"])) {
    include_once "../../../controller/UserController.php";
    $name = $_POST["name"];
    $email = $_POST["email"];
    $pass = $_POST["pass"];
    $phone = $_POST["phone"];
    $role = $_POST["role"];
    $result = UserController::AddUser($name, $pass, $email, $phone, $role);
    if ($result) {
        header("Location:../user_index.php?id=" . $result);
    }
}
if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "showPopupEdit") {
    include_once "../../../controller/UserController.php";
    $id = $_REQUEST["userId"];
    $result = UserController::GetUserByID($id);
    if ($result) {
        require_once "../utils/user_util.php";
        echo UserUtil::createFormEdit($result);
    }
}
if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "update") {
    require_once "../../../controller/UserController.php";
    require_once "../utils/user_util.php";
    $email = $_REQUEST["email"];
    $pass = $_REQUEST["pass"];
    $phone = $_REQUEST["phone"];
    $role = $_REQUEST["role"];
    $id = $_REQUEST["id"];
開發者ID:realolliebee,項目名稱:closes-shop,代碼行數:31,代碼來源:action_user.php

示例2: date

    $radio_gender = $_POST['gender'];
    echo "<br>radio=" . $radio_gender;
    $rsUpdate = UsersBUS::UpdateInfor($id, $username, $radio_gender, $address, $dt1, $dt2, $time);
    if ($rsUpdate == true) {
        Utils::redirect("../thongtinkhachhang.php?update=success");
    } else {
        Utils::redirect("../thongtinkhachhang.php?update=failed");
    }
}
if (isset($_POST["btRegister"])) {
    //echo "register";
    include_once "UserController.php";
    $password = $_POST["txtPassword"];
    $username = $_POST["txtUsername"];
    $phone = $_POST["txtPhone"];
    //$dt2 = $_POST["txtMobile"];
    $email = $_POST["txtEmail"];
    $role = "1";
    //$fRegister="false";
    $time = date('Y-m-d');
    $id = UserController::AddUser($username, $password, $email, $phone, $role);
    if (!empty($id)) {
        $fRegister = "true";
        //echo "suceess";
        //$_SESSION["register"] = "true";
        Utils::redirect("../view/user/product-list.php?type=1&do=login");
    } else {
        echo "failed";
        Utils::redirect("../view/user/register.php?do=failed");
    }
}
開發者ID:realolliebee,項目名稱:closes-shop,代碼行數:31,代碼來源:RegisterProcessor.php


注:本文中的UserController::AddUser方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。