本文整理汇总了PHP中validation::Email方法的典型用法代码示例。如果您正苦于以下问题:PHP validation::Email方法的具体用法?PHP validation::Email怎么用?PHP validation::Email使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类validation
的用法示例。
在下文中一共展示了validation::Email方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: register
public function register($email, $pass, $status, $uname, $acceptterms)
{
$site = new Site();
if ($site->get_setting('registration_on') == 0) {
return '-99';
}
// Currently not accepting registrations
$emailext = explode("@", $email);
$emailext = $emailext[1];
$emailexte = explode(".", $emailext);
$emailext = $emailexte[count($emailexte) - 2] . "." . $emailexte[count($emailexte) - 1];
if ($emailext == "ac.uk") {
$emailext = $emailexte[count($emailexte) - 3] . "." . $emailext;
}
//echo $emailext;
$db = new Database();
$db->connect();
$validation = new validation();
if (!$validation->Email($email)) {
return '-10';
// Not a valid email address
}
if (!$validation->FormalName($uname)) {
return '-11';
// Not a valid name
}
if (!$validation->Number($status) || $status < 1 && $status > 4) {
return '-12';
// Not a valid status
}
if ($acceptterms != 1) {
return '-13';
}
// Did not accept terms
if (strlen($pass) < 3) {
return '-14';
}
// Password not valid
$where = "`email`='" . $email . "'";
$db->select('`user`', '`id`', $where);
$result = $db->getresult();
extract($result);
if ($id > 0) {
return '-4';
}
//Email already in database
$id = NULL;
$where = "`emailextension`='" . $emailext . "'";
$db->select('`school`', '`id`, `name`', $where);
$result = $db->getresult();
//print_r($result);
extract($result);
//echo "$id - $name";
if ($id < 1 && $emailext != 'harvardconnection.co') {
return '-2';
//School extension not valid
}
$schoolname = $name;
$schoolid = $id;
$id = NULL;
$name = NULL;
return $schoolid;
//Check your email yo
}