本文整理匯總了PHP中notification::email方法的典型用法代碼示例。如果您正苦於以下問題:PHP notification::email方法的具體用法?PHP notification::email怎麽用?PHP notification::email使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類notification
的用法示例。
在下文中一共展示了notification::email方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: users
} else {
// echo "<script> alert('3'); </script>";
$stm = "select * from users where email='" . $email . "'";
$res = mysqli_query($conn, $stm);
if (mysqli_num_rows($res) > 0) {
// echo "<script> alert('4'); </script>";
$_SESSION['errorMess'] = 2;
echo "<meta http-equiv='refresh' content='0; url=http://32.208.103.211/chatRegistration/registerHere.php'>";
// echo "<script> alert('5'); </script>";
} else {
// echo "<script> alert('6'); </script>";
$value = 0;
$cnumber = $cc . $cnumber;
$stm = "insert into users(name, lname, email, username, password, contactNumber, activationCode,activated) values('" . $fname . "','" . $lname . "','" . $email . "','" . $uname . "','" . $password . "'," . $cnumber . "," . $activation . "," . $value . ");";
mysqli_query($conn, $stm);
// echo "<script> alert('7'); </script>";
$not = new notification();
$link = "http://32.208.103.211/chatRegistration/activateAccount.php?activationCode=" . $activation . "&email=" . $email;
$body = "Thank you for registering with us.<br><br><a href='" . $link . "'>Click here</a> to activate your account.";
$ans = $not->email("mailtosecureyou@gmail.com", "Administration", "mailtosecureyou@gmail.com", "mailstodeliver", $email, "Activation Email", $body);
$_SESSION['emailSent'] = $ans;
echo "<script> alert('" . $ans . "'); </script>";
if ($ans == 1) {
$refCode = $not->message("12035432147", $cnumber, $link);
}
// echo "<script> alert('8'); </script>";
$_SESSION['newlyRegistered'] = $uname;
echo "<meta http-equiv='refresh' content='0; url=http://32.208.103.211/chatRegistration/imageUpload.php'>";
}
}
mysqli_close($conn);
示例2: realpath
session_start();
define('DOCROOT', realpath(dirname(__FILE__)) . '/');
require DOCROOT . 'dbConn.php';
$con = new dbConn();
$password = $_POST['password'];
$email = $_SESSION['email'];
require DOCROOT . 'activationAndNotifications.php';
$stm = "select pwcr from users where email = '" . $email . "';";
$res = $con->execute($stm);
if ($res->num_rows > 0) {
while ($row = $res->fetch_assoc()) {
if ($row['pwcr'] == 1) {
$stm = "update users set password = '" . $password . "' where email='" . $email . "';";
if ($con->execute($stm) === true) {
$not = new notification();
$body = "Password changed successfully.";
$not->email("mailtosecureyou@gmail.com", "Administration", "mailtosecureyou@gmail.com", "mailstodeliver", $email, "Password Changed Successfully", $body);
$stm = "update users set pcwr = 0 where email = '" . $email . "';";
$con->execute($stm);
$stm = "update users set activationCode = 0 where email = '" . $email . "';";
$con->execute($stm);
$_SESSION['homeMessage'] = "Password has been changed successfully.";
echo "<meta http-equiv='refresh' content='0; url=http://32.208.103.211/chatRegistration/index.php'>";
} else {
$_SESSION['homeMessage'] = "Link has been expired.";
echo "<meta http-equiv='refresh' content='0; url=http://32.208.103.211/chatRegistration/index.php'>";
}
}
}
}
$con->close();
示例3: rand
<?php
session_start();
$email = $_POST['email'];
$activation = rand(1000000000, 9999999999.0);
$_SESSION['email'] = $email;
//define('DOCROOT' realpath(dirname(__FILE__)) . '/');
//require (DOCROOT . 'dbConn.php');
//$con = new dbConn();
$conn = mysqli_connect("localhost", "root", "password", "chat");
require DBROOT . 'activationAndNotifications.php';
echo "<script>alert('here');</script>";
sleep(2);
$stm = "update users set activationCode = " . $activation . " where email='" . $email . "';";
mysqli_query($conn, $stm);
$stm = "update users set pwcr = 1 where email = '" . $email . "';";
if (mysqli_query($conn, $stm) === True) {
$not = new notification();
$link = "http://localhost/chatRegistration/passwordChange.php?activationCode=" . $activation . "&email=" . $email;
$body = "We recieved a request to reset the password and following is the link to reset it. <br><br><a href='" . $link . "'>Click here</a> to reset your password.";
$not->email("mailtosecureyou@gmail.com", "Administration", "mailtosecureyou@gmail.com", "mailstodeliver", $email, "Password Change Request", $body);
$_SESSION['newlyRegistered'] = $uname;
$_SESSION['homeMessage'] = "Email has been sent with all necessary instructions to reset your password.";
echo "<meta http-equiv='refresh' content='0; url=http://32.208.103.211/chatRegistration/index.php'>";
} else {
$_SESSION['error'] = 1;
echo "<meta http-equiv='refresh' content='0; url=http://32.208.103.211/chatRegistration/forgotpassword1.php'>";
}
mysqli_close($conn);