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


PHP Registration::registration方法代碼示例

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


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

示例1: Registration

        <?php 
/**
 * Created by PhpStorm.
 * User: István
 * Date: 2015.12.02.
 * Time: 17:47
 */
require_once $_SERVER['DOCUMENT_ROOT'] . '/rftCandyShop/Model/database/Registration.class.php';
$email = "";
if (!empty($_POST)) {
    $email = $_POST['email'];
    $password = $_POST['password'];
    $passwordC = $_POST['passwordc'];
    $reg = new Registration();
    $back = $reg->registration($email, $password, $passwordC);
    if ($back !== "ok") {
        $error = explode(":", $back);
        foreach ($error as $e) {
            if ($e !== "") {
                echo "<div class='info'>Hiba: {$e}</div>";
            }
        }
    } else {
        $url = $_SERVER['HTTP_REFERER'];
        $redirect = str_replace(basename($_SERVER['PHP_SELF']), "RegSucces.php", $url);
        header("Location: {$redirect}");
    }
}
$selfpage = htmlspecialchars($_SERVER["PHP_SELF"]);
echo <<<_LOGIN_FORM
開發者ID:kubu1518,項目名稱:rftCandyShop,代碼行數:30,代碼來源:RegistrationFrom.php

示例2: redirect

 public function redirect()
 {
     if (isset($_SERVER['PATH_INFO'])) {
         $uri = $_SERVER['PATH_INFO'];
     } else {
         $uri = "";
     }
     if (isset($_SESSION["autorised"])) {
         $controller = null;
         switch ($uri) {
             case "/home":
                 include_once "/core/index.php";
                 $controller = new Home();
                 $controller->view();
                 break;
             case "/test":
             case "/test/start":
             case "/test/testing":
             case "/test/test_end":
                 include_once "/core/test.php";
                 $controller = new Test();
                 if ($uri == "/test") {
                     $controller->view();
                 }
                 if ($uri == "/test/start") {
                     $controller->start();
                 }
                 if ($uri == "/test/testing") {
                     $controller->testing();
                 }
                 if ($uri == "/test/test_end") {
                     $controller->test_end();
                 }
                 break;
             case "/result":
                 include_once "/core/result.php";
                 $controller = new Result();
                 $controller->view();
                 break;
             case "/add_test":
             case "/add_test/test":
             case "/add_test/question":
             case "/add_test/test/add":
             case "/add_test/question/add":
                 include_once "/core/add_test.php";
                 $controller = new Add_Test();
                 if ($uri == "/add_test") {
                     $controller->view();
                 }
                 if ($uri == "/add_test/test") {
                     $controller->new_test();
                 }
                 if ($uri == "/add_test/question") {
                     $controller->new_question();
                 }
                 if ($uri == "/add_test/test/add") {
                     $controller->add_new_test();
                 }
                 if ($uri == "/add_test/question/add") {
                     $controller->add_new_question();
                 }
                 break;
             case "/logout":
                 include_once "/core/logout.php";
                 $controller = new Logout();
                 $controller->logout();
                 break;
             case "/registration":
             case "/registration/registration":
                 include_once "/core/registration.php";
                 $controller = new Registration();
                 if ($uri == "/registration") {
                     $controller->view();
                 }
                 if ($uri == "/registration/registration") {
                     $controller->registration();
                 }
                 break;
             case "/login":
             case "/login/login":
                 include_once "/core/login.php";
                 $controller = new Login();
                 if ($uri == "/login") {
                     $controller->view();
                 } else {
                     $controller->login();
                 }
                 break;
             default:
                 include_once "/core/index.php";
                 $controller = new Home();
                 $controller->view();
                 break;
         }
     } else {
         switch ($uri) {
             case "/registration":
             case "/registration/registration":
                 include_once "/core/registration.php";
                 $controller = new Registration();
//.........這裏部分代碼省略.........
開發者ID:sasha2567,項目名稱:rabota,代碼行數:101,代碼來源:index.php


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