当前位置: 首页>>代码示例>>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;未经允许,请勿转载。