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


PHP DbHandler::activateUser方法代碼示例

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


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

示例1: json_encode

<?php 
include './include/DbHandler.php';
$db = new DbHandler();
$response = array();
$response["error"] = false;
if (isset($_POST['otp']) && $_POST['otp'] != '') {
    $otp = $_POST['otp'];
    $user = $db->activateUser($otp);
    if ($user != NULL) {
        $response["message"] = "User created successfully!";
        $response["profile"] = $user;
    } else {
        $response["message"] = "Sorry! Failed to create your account.";
    }
} else {
    $response["message"] = "Sorry! OTP is missing.";
}
echo json_encode($response);
開發者ID:mekamleshk,項目名稱:OTP-SMS-Verification-in-php,代碼行數:18,代碼來源:verify_otp.php

示例2: function

            }
        }
    } else {
        $response['error'] = true;
        $response['message'] = 'Activation code is not valid!';
    }
    //output final response
    echo $response;
});
//GET Activate route
$app->get('/activate/:x/:y', function ($x, $y) use($app) {
    //    $email = $app->request->get('x');
    //    $active= $app->request->get('y');
    require_once './classes/DbHandler.php';
    $db = new DbHandler();
    $data = $db->activateUser($x, $y);
    echo "<div class=\"content-main opacity\">\n                    <section class=\"content-section contact-section\">\n                        <div class=\"wrap content-contact\">\n                            <div class=\"container-fluid\">\n                                        <header>\n                                        <h2 class=\"entry-header \">Account Activation</h2>\n                                        </header><hr /><br />\n                                    </div>\n                                        ";
    if ($data['message'] == 'USER_ACTIVE_SUCCESS') {
        echo '<h3>Account Activated</h3>';
    } elseif ($data['message'] == 'USER_ACTIVE_FAIL') {
        echo '<h3>Activation Error</h3>';
    } elseif ($data['message'] == 'USER_NOT_EXIST') {
        echo "<h3>User doesn't exist</h3>";
    }
    echo "</div></section></div>";
});
//GET login route
$app->get('/login', function () use($app) {
    $app->render('login.php');
});
//POST login route
開發者ID:clarktk,項目名稱:bingetunes,代碼行數:31,代碼來源:index.php


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