本文整理匯總了PHP中People::Email方法的典型用法代碼示例。如果您正苦於以下問題:PHP People::Email方法的具體用法?PHP People::Email怎麽用?PHP People::Email使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類People
的用法示例。
在下文中一共展示了People::Email方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: mysqli_connect
require 'model/model.php';
require 'dbConnection.php';
$userID = $match[1];
$conn = mysqli_connect(SERVER_ADDRESS, USER_NAME, PASSWORD, DATABASE);
$user = People::getUser($userID, $conn);
if ($user[0] != 1) {
mysqli_close($conn);
header('Content-type: application/json');
echo json_encode(array("status" => false, "msg" => $user[1]));
die;
}
$user = $user[1];
$loginInfo = People::getUserLoginInfo($userID, $conn);
if ($loginInfo[0] != 1) {
mysqli_close($conn);
header('Content-type: application/json');
echo json_encode(array("status" => false, "msg" => "Error! Contact Registration Desk Immediately."));
die;
}
mysqli_close($conn);
$loginInfo = $loginInfo[1];
if (is_null($loginInfo['password'])) {
header('Content-type: application/json');
echo json_encode(array("status" => false, "msg" => "Account already verified."));
die;
}
People::Email($user['email'], $user['name'], $loginInfo['csrfToken'], $userID);
header('Content-type: application/json');
echo json_encode(array("status" => true, "msg" => "Verification link sent to registered email."));
die;
示例2: sendVerificationMailToAll
/**
* In case of Emergency
* Sends Verification mail to all those who have not confirmed
* Need in case,after fixing mass bug on mail system
* @param MySQLi $conn database connection object
*/
public static function sendVerificationMailToAll($conn)
{
$sql = "SELECT * FROM People NATURAL JOIN LoginTable WHERE type > 0 ";
$result = mysqli_query($conn, $sql);
if ($result) {
while ($row = mysqli_fetch_array($result, MYSQL_ASSOC)) {
$email = $row['email'];
$name = $row['name'];
$token = $row['csrfToken'];
$pid = $row['pId'];
People::Email($email, $name, $token, $pid, false);
echo "Email send to " . $email . "\n";
}
} else {
echo "Error in Query Execution";
}
}