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


PHP DB_Functions::validEmail方法代码示例

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


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

示例1:

 $lname = $_POST['lname'];
 $email = $_POST['email'];
 $uname = $_POST['uname'];
 $password = $_POST['password'];
 $subject = "Registration";
 $message = "Hello {$fname},\n\nYou have sucessfully registered to the Piggy Rewards Loyalty program. You may begin using all of our services. \n\nRegards,\nAdmin, Loyalty Rewards Team.";
 $from = "svetvaz@gmail.com";
 $headers = "From:" . $from;
 // check if user is already existed
 if ($db->isUserExisted($email)) {
     // user is already existed - error response
     $response["error"] = 2;
     $response["error_msg"] = "User already exists.Click on 'Forgot Password to retrieve your password'";
     echo json_encode($response);
 } else {
     if (!$db->validEmail($email)) {
         $response["error"] = 3;
         $response["error_msg"] = "Invalid Email Id";
         echo json_encode($response);
     } else {
         // store user
         $user = $db->storeUser($fname, $lname, $email, $uname, $password);
         if ($user) {
             // user stored successfully
             $response["success"] = 1;
             $response["user"]["fname"] = $user["firstname"];
             $response["user"]["lname"] = $user["lastname"];
             $response["user"]["email"] = $user["email"];
             $response["user"]["uname"] = $user["username"];
             $response["user"]["uid"] = $user["unique_id"];
             $response["user"]["created_at"] = $user["created_at"];
开发者ID:yangmc423,项目名称:AndroidLoginExample,代码行数:31,代码来源:index.php

示例2:

 $date_of_birth = $_POST['date_of_birth'];
 $security_question = $_POST['security_question'];
 $security_answer = $_POST['security_answer'];
 $user_password = $_POST['user_password'];
 $subject = "Registration";
 $message = "Hello {$first_name},\n\nYou have sucessfully registered to our service.\n\nRegards,\nStampsHub.";
 $from = "harsh@stampshubdemo.site50.net";
 $headers = "From:" . $from;
 // check if user is already existed
 if ($db->isUserExisted($email_id)) {
     // user is already existed - error response
     $response["error"] = 2;
     $response["error_msg"] = "User already existed";
     echo json_encode($response);
 } else {
     if (!$db->validEmail($email_id)) {
         $response["error"] = 3;
         $response["error_msg"] = "Invalid Email Id";
         echo json_encode($response);
     } else {
         // store user
         $user = $db->storeUser($utype, $first_name, $last_name, $email_id, $user_gender, $phone_number, $date_of_birth, $security_question, $security_answer, $user_password);
         if ($user) {
             // user stored successfully
             $response["success"] = 1;
             $response["user"]["utype"] = $user["utype"];
             $response["user"]["first_name"] = $user["first_name"];
             $response["user"]["last_name"] = $user["last_name"];
             $response["user"]["email_id"] = $user["email_id"];
             $response["user"]["user_gender"] = $user["user_gender"];
             $response["user"]["phone_number"] = $user["phone_number"];
开发者ID:harshj94,项目名称:StampsHub,代码行数:31,代码来源:index.php


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