本文整理汇总了PHP中checkEmail函数的典型用法代码示例。如果您正苦于以下问题:PHP checkEmail函数的具体用法?PHP checkEmail怎么用?PHP checkEmail使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了checkEmail函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addUser
function addUser($username, $email, $password, $avatar, $steamid)
{
//Check if user exists
$checkLogin = checkUserLogin($username);
if ($checkLogin == FALSE) {
//Loginname doesn't exist
//Check if email exists
$checkEmail = checkEmail($email);
if ($checkEmail == FALSE) {
//Email doesn't exist
$thisUser = new User();
$thisUser->username = $username;
$thisUser->loginname = $username;
$thisUser->password = encryptPassword($password);
$thisUser->email = $email;
$thisUser->avatar = $avatar;
$thisUser->steamid = $steamid;
$thisUser->save();
return TRUE;
} else {
//Email exists
return FALSE;
}
} else {
//Loginname exists
return FALSE;
}
}
示例2: registerFormValidate
function registerFormValidate($email, $username, $passwd, $cpasswd, $phone)
{
$msg = "";
// if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
// $msg = " Please Enter a valid email id.";
// }
if (existAccount($username)) {
$msg .= " Try a different username.";
}
if (checkEmail($email)) {
$msg .= " Invalid email format";
} else {
if (existEmail($email)) {
$msg .= " Email already taken up.";
}
}
if (existPhone($phone)) {
$msg .= " Phone number already registered.";
}
if ($passwd != $cpasswd) {
$msg .= " Confirm password doesn't match with password.";
} else {
if (strlen($passwd) < 6) {
$msg .= " Password should be atleast 6 characters long.";
}
}
if ($msg == "") {
$valid = 1;
} else {
$valid = $msg;
}
return $valid;
}
示例3: userCheck
function userCheck($uname, $email, $pass, $vpass)
{
global $myxoopsConfigUser;
$xoopsDB =& Database::getInstance();
$stop = '';
if (!checkEmail($email)) {
$stop .= _US_INVALIDMAIL . '<br />';
}
foreach ($myxoopsConfigUser['bad_emails'] as $be) {
if (!empty($be) && preg_match('/' . $be . '/i', $email)) {
$stop .= _US_INVALIDMAIL . '<br />';
break;
}
}
if (strrpos($email, ' ') > 0) {
$stop .= _US_EMAILNOSPACES . '<br />';
}
$uname = xoops_trim($uname);
$restrictions = array(0 => '/[^a-zA-Z0-9\\_\\-]/', 1 => '/[^a-zA-Z0-9\\_\\-\\<\\>\\,\\.\\$\\%\\#\\@\\!\\\'\\"]/', 2 => '/[\\000-\\040]/');
$restriction = $restrictions[$myxoopsConfigUser['uname_test_level']];
if (empty($uname) || preg_match($restriction, $uname)) {
$stop .= _US_INVALIDNICKNAME . '<br />';
}
if (strlen($uname) > $myxoopsConfigUser['maxuname']) {
$stop .= sprintf(_US_NICKNAMETOOLONG, $myxoopsConfigUser['maxuname']) . '<br />';
}
if (strlen($uname) < $myxoopsConfigUser['minuname']) {
$stop .= sprintf(_US_NICKNAMETOOSHORT, $myxoopsConfigUser['minuname']) . '<br />';
}
foreach ($myxoopsConfigUser['bad_unames'] as $bu) {
if (!empty($bu) && preg_match('/' . $bu . '/i', $uname)) {
$stop .= _US_NAMERESERVED . '<br />';
break;
}
}
if (strrpos($uname, ' ') > 0) {
$stop .= _US_NICKNAMENOSPACES . '<br />';
}
$u_handler =& xoonips_getormhandler('xoonips', 'xoops_users');
$criteria = new Criteria('uname', addslashes($uname));
if ($u_handler->getCount($criteria) > 0) {
$stop .= _US_NICKNAMETAKEN . "<br />";
}
if ($email) {
$criteria = new Criteria('email', addslashes($email));
if ($u_handler->getCount($criteria) > 0) {
$stop .= _US_EMAILTAKEN . "<br />";
}
}
if (!isset($pass) || $pass == '' || !isset($vpass) || $vpass == '') {
$stop .= _US_ENTERPWD . '<br />';
}
if (isset($pass) && $pass != $vpass) {
$stop .= _US_PASSNOTSAME . '<br />';
} elseif ($pass != '' && strlen($pass) < $myxoopsConfigUser['minpass']) {
$stop .= sprintf(_US_PWDTOOSHORT, $myxoopsConfigUser['minpass']) . '<br />';
}
return $stop;
}
示例4: checkVar_user_email
function checkVar_user_email(&$value)
{
if ($value) {
//メール形式のチェックは既に行っているが、メッセージを判りやすく
if (!checkEmail($value)) {
$this->setErrors(_LANG_WPF_ERR_CORRECT);
return false;
}
}
}
示例5: valCamps
function valCamps($Email, $Message)
{
if (empty($Email) || empty($Message)) {
echo '<div class="alert alert-warning" role="alert">check the inputs</div>';
} else {
if (!checkEmail($Email)) {
echo '<div class="alert alert-success" role="alert">Message Send</div>';
} else {
echo '<div class="alert alert-warning" role="alert">Check the Email</div>';
}
}
}
示例6: signup
function signup()
{
//connect to database
require 'mysql.php';
$fname = mysql_real_escape_string($_POST['fname']);
$lname = mysql_real_escape_string($_POST['lname']);
$email = mysql_real_escape_string($_POST['email']);
$pkey = 'Torah';
$hash = crypt($email . $pkey);
$sql = "INSERT INTO maillist (fname, lname, email, hash)\nVALUES\n('{$fname}','{$lname}','{$email}', '{$hash}')";
$sqlcheck = "SELECT email FROM maillist WHERE email ='{$email}' ";
$query = mysql_query($sqlcheck, $con);
// validate submission
if (!empty($_POST["email"]) && checkEmail($_POST["email"]) && mysql_num_rows($query) == 0) {
$to = $email;
$subject = "You have been added to the mailing list!";
$body = 'Dear ' . $fname . ',<br /><br />' . 'Thank you for joining my mailing list. <br /><br />' . 'Sincerely,<br /><br />' . 'Marty Goodman' . '<br /><br />' . '<a href="http://bais-mordechai.com/unsubscribe.php?u=' . $hash . '">Unsubscribe</a>';
$message = '
<html>
<head>
<title>You have been added to the mailing list!</title>
</head>
<body>' . $body . '</body>
</html>
';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From:Marty@bais-mordechai.com\r\n";
mail($to, $subject, $message, $headers);
$to = "binyomintrager@gmail.com";
$subject = "New Member";
$body = "Name = " . $_POST["fname"] . " " . $_POST["lname"] . "\n\n" . "Email = " . $_POST["email"];
mail($to, $subject, $body, $headers);
mysql_query($sql);
echo '<h3>You have been added to the mailing list.</h3>';
} else {
$query = mysql_query($sqlcheck, $con);
if (empty($_POST["email"])) {
echo '<h3>You must enter an e-mail address</h3>';
} else {
if (!checkEmail($_POST["email"])) {
echo '<h3>Please enter a valid e-mail address.</h3>';
} else {
if (mysql_num_rows($query) > 0) {
echo '<h3>You are already on the mailing list.</h3>';
}
}
}
echo '<br /><a href="MailList.php">Back</a>';
}
mysql_close($con);
}
示例7: verifyUserModInput
/**
* Verify Input on add
*/
function verifyUserModInput($userModDetails)
{
# real name must be entered
if (!$userModDetails['real_name']) {
$errors[] = _('Real name field is mandatory!');
}
# Both passwords must be same
if ($userModDetails['password1'] != $userModDetails['password2']) {
$errors[] = _("Passwords do not match!");
}
# pass must be at least 8 chars long for non-domain users
if ($userModDetails['domainUser'] != 1) {
if (strlen($userModDetails['password1orig']) < 8 && strlen($userModDetails['password1orig']) != 0) {
$errors[] = _("Password must be at least 8 characters long!");
} else {
if ($userModDetails['action'] == "add" && strlen($userModDetails['password1orig']) < 8) {
$errors[] = _("Password must be at least 8 characters long!");
}
}
}
# email format must be valid
if (!checkEmail($userModDetails['email'])) {
$errors[] = _("Invalid email address!");
}
# username must not already exist (if action is add)
if ($userModDetails['action'] == "add") {
global $db;
# get variables from config file
$database = new database($db['host'], $db['user'], $db['pass'], $db['name']);
# open db connection
$query = 'select * from users where username = "' . $userModDetails['username'] . '";';
# set query and fetch results
/* execute */
try {
$details = $database->getArray($query);
} catch (Exception $e) {
$error = $e->getMessage();
die("<div class='alert alert-error'>" . _('Error') . ": {$error}</div>");
}
# user already exists
if (sizeof($details) != 0) {
$errors[] = _("User") . " " . $userModDetails['username'] . " " . _("already exists!");
}
}
# return errors
return $errors;
}
示例8: send_message
function send_message()
{
global $xoopsModule, $xoopsModuleConfig, $xoopsUser;
$name = rmc_server_var($_POST, 'name', '');
$email = rmc_server_var($_POST, 'email', '');
$company = rmc_server_var($_POST, 'company', '');
$phone = rmc_server_var($_POST, 'phone', '');
$subject = rmc_server_var($_POST, 'subject', '');
$message = rmc_server_var($_POST, 'message', '');
if ($name == '' || $email == '' || !checkEmail($email) || $subject == '' || $message == '') {
redirect_header($xoopsModuleConfig['url'], 1, __('Please fill all required fileds before to send this message!', 'contact'));
die;
}
// Recaptcha check
if (!RMEvents::get()->run_event('rmcommon.captcha.check', true)) {
redirect_header($xoopsModuleConfig['url'], 1, __('Please check the security words and write it correctly!', 'contact'));
die;
}
$xoopsMailer =& getMailer();
$xoopsMailer->useMail();
$xoopsMailer->setBody($message . "\n--------------\n" . __('Message sent with ContactMe!', 'contact') . "\n" . $xoopsModuleConfig['url']);
$xoopsMailer->setToEmails($xoopsModuleConfig['mail']);
$xoopsMailer->setFromEmail($email);
$xoopsMailer->setFromName($name);
$xoopsMailer->setSubject($subject);
if (!$xoopsMailer->send(true)) {
redirect_header($xoopsModuleConfig['url'], 1, __('Message could not be delivered. Please try again.', 'contact'));
die;
}
// Save message on database for further use
$msg = new CTMessage();
$msg->setVar('subject', $subject);
$msg->setVar('ip', $_SERVER['REMOTE_ADDR']);
$msg->setVar('email', $email);
$msg->setVar('name', $name);
$msg->setVar('org', $company);
$msg->setVar('body', $message);
$msg->setVar('phone', $phone);
$msg->setVar('register', $xoopsUser ? 1 : 0);
if ($xoopsUser) {
$msg->setVar('xuid', $xoopsUser->uid());
}
$msg->setVar('date', time());
$msg->save();
redirect_header(XOOPS_URL, 1, __('Your message has been sent successfully!', 'contact'));
}
示例9: upload_contacts
function upload_contacts($file)
{
$file_handle = fopen($file, "r");
$count = 0;
while (!feof($file_handle)) {
$line_of_text = fgetcsv($file_handle, 1024);
$row['subscriber_email_address'] = $line_of_text[0];
$row['subscriber_newsletter_agree'] = 1;
$row['subscriber_date_added'] = time();
$row['subscriber_name'] = $line_of_text[1];
if (checkEmail($line_of_text[0])) {
dbPerform('subscribers', $row, 'insert');
}
$count++;
}
fclose($file_handle);
return $count;
}
示例10: validateEmail
function validateEmail($email)
{
if ($email == '') {
$_SESSION['error']['email'] = 'email should not be blank';
return false;
} else {
$emailRegEx = '/^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$/';
if (preg_match($emailRegEx, $email)) {
$checkEmail = checkEmail($email);
if ($checkEmail === false) {
$_SESSION['error']['email'] = 'user already exists';
return false;
} else {
return true;
}
} else {
$_SESSION['error']['email'] = 'enter valid email';
return false;
}
}
}
示例11: relinquishContacts
/**
* Created by Yogesh on 11/30/2015.
*
*/
function relinquishContacts($contact)
{
$phone = "";
$website = "";
$email = "";
if ($contact != "null") {
$contacts = explode(',', $contact);
foreach ($contacts as $value) {
if (checkWebsite($value)) {
$website = $value;
} else {
if (checkEmail($value)) {
$email = $value;
} else {
$phone = $value;
}
}
}
}
return array($phone, $email, $website);
}
示例12: validate_fields
function validate_fields()
{
/* Make sure the name field is filled in from the form. */
if (empty($_POST['name'])) {
$response_array['status'] = 'name error';
$response_array['message'] = '<div class="alert alert-error">Name is blank</div>';
} else {
if (!checkEmail($_POST['email'])) {
$response_array['status'] = 'check email error';
$response_array['message'] = '<div class="alert alert-error">Email is blank or invalid</div>';
return false;
} else {
if (empty($_POST['message'])) {
$response_array['status'] = 'message error';
$response_array['message'] = '<div class="alert alert-error">Message is blank</div>';
return false;
} else {
return true;
}
}
}
}
示例13: getConfirmView
function getConfirmView()
{
global $xoopsConfig;
$myts =& MyTextSanitizer::getInstance();
$usersName = $myts->stripSlashesGPC($this->utils->getPost('usersName', ''));
$usersEmail = $myts->stripSlashesGPC($this->utils->getPost('usersEmail', ''));
$usersComments = $myts->stripSlashesGPC($this->utils->getPost('usersComments', ''));
//チケットの確認
// if(!$ticket_check = $this->ticket->check())
if (!($ticket_check = $this->ticket->check(true, '', false))) {
return _MD_XMOBILE_TICKET_ERROR;
}
if (!checkEmail($usersEmail)) {
return _MD_XMOBILE_INVALIDMAIL;
}
$detail4html = '';
if ($usersName !== '' && $usersEmail !== '' && $usersComments !== '') {
$subject = $xoopsConfig['sitename'] . ' - ' . _MD_XMOBILE_FROM_MOBILE . _CT_CONTACTFORM;
$adminMessage = "";
$adminMessage .= sprintf(_CT_SUBMITTED, $usersName) . "\n";
$adminMessage .= _CT_EMAIL . " " . $usersEmail . "\n";
$adminMessage .= "HTTP_USER_AGENT:" . $_SERVER['HTTP_USER_AGENT'] . "\n";
$adminMessage .= _CT_COMMENTS . "\n";
$adminMessage .= $usersComments . "\n";
$xoopsMailer =& getMailer();
$xoopsMailer->useMail();
$xoopsMailer->setToEmails($xoopsConfig['adminmail']);
$xoopsMailer->setFromEmail($usersEmail);
$xoopsMailer->setFromName($xoopsConfig['sitename']);
$xoopsMailer->setSubject($subject);
$xoopsMailer->setBody($adminMessage);
$xoopsMailer->send();
// $detail4html .= sprintf(_CT_MESSAGESENT,$xoopsConfig['sitename']).'<br />'._CT_THANKYOU;
$detail4html .= _CT_THANKYOU;
} else {
$detail4html .= _MD_XMOBILE_SENDMAIL_FAILED . '<br />';
}
$this->controller->render->template->assign('item_detail', $detail4html);
}
示例14: checkLogin
public function checkLogin()
{
$is_bind = I("post.is_bind", 0, 'int');
$pwd = I('post.pwd');
$username = I('post.username');
if (checkEmail($username) == 'true') {
$info = M("user")->field("id,nickname")->where("email = '" . $username . "' AND pwd = '" . md5($pwd) . "'")->find();
} else {
$info = M("user")->field("id,nickname")->where("name = '" . $username . "' AND pwd = '" . md5($pwd) . "'")->find();
}
if (empty($info)) {
echo json_encode(array("error" => "您输入的用户名/邮箱/密码无效。"));
exit;
} else {
$userid = $info['id'];
}
$nickname = $info['nickname'];
$tip = "登录成功!";
if ($is_bind == 1) {
//若是绑定
$openid = getSessionCookie("openid");
if ($openid) {
$field = getSessionCookie("field");
$userinfo = M("user")->field('id,name')->where("" . $field . "= '" . $openid . "'")->find();
if (!$userinfo) {
//没有的话绑定账号,送积分和发广告,有绑定的话直接登录
// 绑定账号
M('user')->where("id = " . $userid . "")->save(array($field => $openid));
emptySessionCookie('type');
emptySessionCookie('openid');
}
}
}
setSessionCookie("userid", $userid);
setSessionCookie("username", getNickname($username, $nickname));
echo json_encode(array("username" => $username, "userid" => $userid, "avatar" => getUserAvatar($userid), "tip" => $tip, "error" => ""));
}
示例15: __construct
/**
* Handles lost password requests.
*
* @param string $username Entered username
* @param string $email Entered email address
*
* @return Bengine_Game_Account_Password_Lost
*/
public function __construct($username, $email)
{
$this->username = $username;
$this->email = $email;
$mode = 1;
if (!$this->getUsername()) {
$mode = 0;
}
if (!checkEmail($this->getEmail())) {
$this->printIt("EMAIL_INVALID");
}
$result = Core::getQuery()->select("user", array("userid", "username"), "", Core::getDB()->quoteInto("email = ?", $this->getEmail()));
if ($result->rowCount() <= 0) {
$this->printIt("EMAIL_NOT_FOUND");
}
$row = $result->fetchRow();
$result->closeCursor();
Core::getLanguage()->assign("username", $row["username"]);
Core::getLanguage()->assign("ipaddress", IPADDRESS);
Hook::event("LostPassword", array($this, &$row));
if ($mode == 0) {
$this->message = new Recipe_Email_Template("lost_password_username");
} else {
if (Str::compare($this->getUsername(), $row["username"])) {
$reactivate = BASE_URL . Core::getLang()->getOpt("langcode") . "/signup/activation/key:" . $this->getSecurityKey();
$url = BASE_URL . Core::getLang()->getOpt("langcode") . "/password/set/key:" . $this->getSecurityKey() . "/user:" . $row["userid"];
Core::getTemplate()->assign("newPasswordUrl", $url);
Core::getTemplate()->assign("reactivationUrl", $reactivate);
$this->message = new Recipe_Email_Template("lost_password_password");
$this->setNewPw();
} else {
$this->printIt("USERNAME_DOES_NOT_EXIST");
}
}
$this->sendMail($mode);
return;
}