本文整理汇总了PHP中security::isCorrectEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP security::isCorrectEmail方法的具体用法?PHP security::isCorrectEmail怎么用?PHP security::isCorrectEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类security
的用法示例。
在下文中一共展示了security::isCorrectEmail方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unset
<?php
if (isset($_POST['replacemail1'])) {
if (!security::isSecureString($_SESSION['username'], 3)) {
$errors[] = "Username field contains forbidden symbols";
}
if (!security::isSecureString($_POST['email'], 2)) {
$errors[] = "Email field contains forbidden symbols";
}
if (!security::isCorrectEmail($_POST['email'])) {
$errors[] = "Invalid email address";
}
if (count($errors) > 0) {
for ($i = 0; $i < count($errors); $i++) {
echo $errors[$i] . ".<br/>";
}
} else {
core::$sql->changeDB('acc');
$user = $_SESSION['username'];
$email = $_POST['email'];
if (empty($_SESSION['username']) || empty($_POST['email'])) {
echo 'Error :';
echo '<br />';
echo "You left some fields blank! <a href = '?pg=forgot'>go back and try again!</a>";
unset($_POST['replacemail1']);
} else {
$check = core::$sql->numRows("select Name from TB_User where StrUserID = '{$user}' and Email = '{$email}'");
if ($check !== 1) {
echo 'Error :';
echo '<br />';
echo "User with following email/password doesn't exist! <a href = '?pg=forgot'>go back and try again!</a>";
示例2:
}
break;
case 'myprofile':
//module disabled
if ($core->aConfig['allowMyProfile'] == 0) {
echo "This module is currently disabled.";
return;
}
if (isset($_POST['submit'])) {
$nGender = (int) $_POST['gender'];
$szAvatarUrl = null;
$szSkype = null;
$szMsn = null;
$nPublic = (int) $_POST['ispublic'];
security::isValidUrl($_POST['avatar']) ? $szAvatarUrl = $_POST['avatar'] : ($szAvatarUrl = $core->aConfig[url] . "img/noavatar.png");
security::isCorrectEmail($_POST['msn']) ? $szMsn = $_POST['msn'] : ($szMsn = "None");
$szSkype = security::toHTML($_POST['skype']);
if (strlen($szSkype) > 50) {
$szSkype = "None";
}
if (strlen($szMsn) > 60) {
$szMsn = "None";
}
if (strlen($szAvatarUrl) > 500) {
$szAvatarUrl = $core->aConfig['url'] . "img/noavatar.png";
}
$avatarImageData = @getimagesize($szAvatarUrl);
//no error if shit happens
if (empty($avatarImageData[0]) || empty($avatarImageData[1])) {
$avatarImageData[0] = 0;
$avatarImageData[1] = 0;