本文整理汇总了PHP中Filter::email方法的典型用法代码示例。如果您正苦于以下问题:PHP Filter::email方法的具体用法?PHP Filter::email怎么用?PHP Filter::email使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Filter
的用法示例。
在下文中一共展示了Filter::email方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Soup
<?php
require_once "../../global.php";
if (Session::isLoggedIn()) {
Session::signOut();
}
// get email, if exists
$email = @Filter::email($_GET['email']);
$soup = new Soup();
if (!empty($email)) {
$soup->set('email', $email);
}
$soup->render('site/page/consent_adult');
示例2: exit
exit(json_encode($json));
}
// new passwords provided?
if ($pw != "" || $pw2 != "") {
// do the passwords match?
if ($pw != $pw2) {
$json = array('error' => 'Sorry, your new passwords do not match.');
exit(json_encode($json));
}
}
// validate email address
if ($email == "") {
$json = array('error' => 'You must provide a valid email address.');
exit(json_encode($json));
}
if (!Filter::email($email)) {
$json = array('error' => 'You must provide a valid email address.');
exit(json_encode($json));
}
// must provide birthdate
if ($month == "0" || $year == "0") {
$json = array('error' => 'You must select a valid birth month and year to register.');
exit(json_encode($json));
}
// convert birthdate to MySQL format
$dob = $year . "-" . $month . "-01";
// required fields
$user->setEmail($email);
if ($pw != "") {
// convert password to MD5 hash
$pw = sha1($pw);
示例3: email
/**
* Validate emil
*
* @param $email
* @return mixed
*
* @deprecated See JBZoo\Utils\Email
*/
public static function email($email)
{
return Filter::email($email);
}
示例4: array
$body .= '<p>Once you log in, you can change this password to something more memorable by clicking the "Edit" button on your <a href="' . Url::user($user->getID()) . '">profile</a> page.</p>';
$body .= '<p>Note: If you did not request this password change, please contact the ' . PIPELINE_NAME . ' staff.</p>';
$newEmail = array('to' => $user->getEmail(), 'subject' => '[' . PIPELINE_NAME . '] Password changed for ' . $user->getUsername(), 'message' => $body);
Email::send($newEmail);
// redirect
Session::setMessage('Your password was reset. Please check your email for the new password.');
$json = array('success' => '1', 'successUrl' => Url::logIn());
exit(json_encode($json));
} elseif ($action == 'login') {
// assign POST vars to local vars after escaping and removing unwanted spacing.
if (!empty($_POST['username']) && !empty($_POST['password'])) {
$username = Filter::text($_POST['username']);
$password = sha1(Filter::text($_POST['password']));
$referer = Filter::text($_POST['referer']);
// figure out if user provided username or email address
if (Filter::email($username)) {
$user = User::loadByEmail($username);
} else {
$user = User::loadByUsername($username);
}
if ($user != null) {
if ($password == $user->getPassword()) {
// remember user?
$remember = Filter::text($_POST['remember']);
$remember = $remember == 'remember' ? true : false;
// sign in
Session::signIn($user->getID(), $remember);
// send us onward
if (!empty($referer) && $referer != Url::forgotPassword()) {
$json = array('success' => '1', 'successUrl' => $referer);
} else {
示例5: json_encode
<?php
require_once "../../global.php";
$email = Filter::email($_POST['email']);
$name = Filter::text($_POST['name']);
// must provide valid email
if (empty($email)) {
$json = array('error' => 'You must provide a valid email address.');
exit(json_encode($json));
}
// save consent
$consent = new Consent(array('email' => $email, 'name' => $name));
$consent->save();
// email confirmation
$body = '<p>You have consented to participate in a Georgia Tech research study looking at how people collaborate online.</p>';
if (!empty($name)) {
$body .= "<p>Additionally, you have requested that we use your real name if we refer to you in our publications.</p>";
}
$body .= '<p>The consent form is available for viewing and printing at <a href="http://www.scribd.com/doc/66688220/Adult-Web-Consent-Testing?secret_password=4nzp5x09db318hcu9e2">this link</a>. Please retain a copy for your records.</p>';
$body .= '<p>If you have any questions or concerns, please contact the research team at <a href="mailto:' . CONTACT_EMAIL . '">' . CONTACT_EMAIL . '</a>. Thank you for your participation!</p>';
$body .= '<p>-- <a href="http://pipeline.cc.gatech.edu/">The Pipeline team</a> at Georgia Tech</p>';
$newEmail = array('to' => $email, 'subject' => 'Georgia Tech study consent form', 'message' => $body);
Email::send($newEmail);
// send us back
Session::setMessage("Consent form complete! Please register an account.");
$json = array('success' => '1', 'successUrl' => Url::register($email));
echo json_encode($json);