本文整理汇总了PHP中checkmail函数的典型用法代码示例。如果您正苦于以下问题:PHP checkmail函数的具体用法?PHP checkmail怎么用?PHP checkmail使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了checkmail函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unsetcookies
function unsetcookies()
{
foreach (func_get_args() as $name) {
if (!empty($name) && !empty($_COOKIE[$name])) {
setcookie($name, '', time() - 3600);
unset($_COOKIE[$name]);
}
}
}
if (!empty($_COOKIE['clearsettings'])) {
unsetcookies('domail', 'email', 'saveto', 'path', 'useproxy', 'proxy', 'proxyuser', 'proxypass', 'split', 'partSize', 'savesettings', 'clearsettings', 'premium_acc', 'premium_user', 'premium_pass');
}
if (!empty($_GET['savesettings']) && $_GET['savesettings'] == 'on') {
$expiretime = time() + 800600;
setcookie('savesettings', '1', $expiretime);
if (!empty($_GET['domail']) && $_GET['domail'] == 'on' && !empty($_GET['email']) && checkmail($_GET['email'])) {
setcookie('domail', '1', $expiretime);
setcookie('email', $_GET['email'], $expiretime);
if (!empty($_GET['split']) && $_GET['split'] == 'on') {
setcookie('split', '1', $expiretime);
if (!empty($_GET['partSize']) && is_numeric($_GET['partSize'])) {
setcookie('partSize', $_GET['partSize'], $expiretime);
} else {
unsetcookies('partSize');
}
if (!empty($_GET['method']) && in_array($_GET['method'], array('tc', 'rfc'))) {
setcookie('method', $_GET['method'], $expiretime);
} else {
unsetcookies('method');
}
} else {
示例2:
if (strlen($yourname) > 40) {
$error .= "<br>{$error1}";
}
if (empty($yourname)) {
$error .= "<br>{$error4}";
}
}
// Email Validation Section ----------------------------
if ($email_optional != 1) {
if (strlen($youremail) > 40) {
$error .= "<br>{$error2}";
}
if (empty($youremail)) {
$error .= "<br>{$error5}";
}
if (checkmail($youremail) != 1) {
$error .= "<br>{$error3}";
}
}
// Message Validation Section ---------------------------
if ($message_optional != 1) {
if (empty($yourmessage)) {
$error .= "<br>{$error6}";
}
}
// Exit Program if there is an error --------------------
if ($error) {
$z = "1";
echo $error;
echo "<center><br><a href=\"javascript:history.go(-1)\" class=\"text\">{$goback}</a></center>";
include "footer.inc";
示例3: myprofile
function myprofile()
{
global $set, $apx, $db;
//Weiterleisten auf Loginseite, wenn nicht angemeldet
if (!$apx->user->info['userid']) {
header('Location: index.php');
}
if ($_POST['send'] == 1) {
if (!checkToken()) {
infoInvalidToken();
} elseif (!$_POST['username'] || ($_POST['pwd1'] || $_POST['pwd2']) && (!$_POST['pwd1'] || !$_POST['pwd2']) || !$_POST['email']) {
infoNotComplete();
} elseif ($_POST['pwd1'] != $_POST['pwd2']) {
info($apx->lang->get('INFO_PWNOMATCH'));
} elseif (strlen($_POST['signature']) > $set['user']['sigmaxlen']) {
info($apx->lang->get('INFO_SIGTOOLONG'));
} elseif (!checkmail($_POST['email'])) {
info($apx->lang->get('INFO_NOMAIL'));
} else {
if (substr($_POST['homepage'], 0, 4) == 'www.') {
$_POST['homepage'] = 'http://' . $_POST['homepage'];
}
if ($_POST['pwd1']) {
$_POST['salt'] = random_string();
$_POST['password'] = md5(md5($_POST['pwd1']) . $_POST['salt']);
}
if ($_POST['bd_day'] && $_POST['bd_mon'] && $_POST['bd_year']) {
$_POST['birthday'] = sprintf('%02d-%02d-%04d', $_POST['bd_day'], $_POST['bd_mon'], $_POST['bd_year']);
} elseif ($_POST['bd_day'] && $_POST['bd_day']) {
$_POST['birthday'] = sprintf('%02d-%02d', $_POST['bd_day'], $_POST['bd_mon']);
} else {
$_POST['birthday'] = '';
}
//Location bestimmen
$_POST['locid'] = user_get_location($_POST['plz'], $_POST['city'], $_POST['country']);
$db->dupdate(PRE . '_user', iif($_POST['pwd1'], 'password,salt,') . 'username,email,homepage,icq,aim,yim,msn,skype,realname,gender,birthday,city,plz,country,locid,interests,work,custom1,custom2,custom3,custom4,custom5,custom6,custom7,custom8,custom9,custom10,signature,pub_lang,pub_invisible,pub_hidemail,pub_poppm,pub_usegb,pub_gbmail,pub_profileforfriends,pub_showbuddies,pub_theme,admin_lang,admin_editor' . iif($apx->is_module('forum'), ',forum_autosubscribe'), "WHERE userid='" . $apx->user->info['userid'] . "'");
logit('USER_MYPROFILE');
if ($_POST['pwd1']) {
$apx->session->destroy();
setcookie($set['main']['cookie_pre'] . '_admin_userid', 0, time() - 99999, '/');
setcookie($set['main']['cookie_pre'] . '_admin_password', 0, time() - 99999, '/');
unset($_COOKIE[$set['main']['cookie_pre'] . '_admin_userid'], $_COOKIE[$set['main']['cookie_pre'] . '_admin_password']);
}
printJSRedirect('action.php?action=user.myprofile');
}
} else {
$ex = array('userid', 'password', 'birthday', 'reg_time', 'reg_email', 'lastonline', 'lastactive');
foreach ($apx->user->info as $key => $val) {
if (in_array($key, $ex)) {
continue;
}
$_POST[$key] = $val;
}
list($_POST['bd_day'], $_POST['bd_mon'], $_POST['bd_year']) = explode('-', $apx->user->info['birthday']);
//Sprache
foreach ($apx->languages as $id => $name) {
$lang_admin .= '<option value="' . $id . '"' . iif($_POST['admin_lang'] == $id, ' selected="selected"') . '>' . $name . '</option>';
$lang_pub .= '<option value="' . $id . '"' . iif($_POST['pub_lang'] == $id, ' selected="selected"') . '>' . $name . '</option>';
}
//Themes
$handle = opendir(BASEDIR . getpath('tmpldir'));
while ($file = readdir($handle)) {
if ($file == '.' || $file == '..' || !is_dir(BASEDIR . getpath('tmpldir') . $file)) {
continue;
}
$themes[] = $file;
}
closedir($handle);
sort($themes);
foreach ($themes as $themeid) {
$themelist .= '<option value="' . $themeid . '"' . iif($themeid == $_POST['pub_theme'], ' selected="selected"') . '>' . $themeid . '</option>';
}
//Custom-Felder
for ($i = 1; $i <= 10; $i++) {
$fieldname = $set['user']['cusfield_names'][$i - 1];
$apx->tmpl->assign('CUSFIELD' . $i . '_NAME', replace($fieldname));
$apx->tmpl->assign('CUSTOM' . $i, compatible_hsc($_POST['custom' . $i]));
}
$apx->tmpl->assign('USERNAME_LOGIN', replace($_POST['username_login']));
$apx->tmpl->assign('USERNAME', compatible_hsc($_POST['username']));
$apx->tmpl->assign('EMAIL', compatible_hsc($_POST['email']));
$apx->tmpl->assign('HOMEPAGE', compatible_hsc($_POST['homepage']));
$apx->tmpl->assign('ICQ', (int) $_POST['icq']);
$apx->tmpl->assign('AIM', compatible_hsc($_POST['aim']));
$apx->tmpl->assign('YIM', compatible_hsc($_POST['yim']));
$apx->tmpl->assign('MSN', compatible_hsc($_POST['msn']));
$apx->tmpl->assign('SKYPE', compatible_hsc($_POST['skype']));
$apx->tmpl->assign('REALNAME', compatible_hsc($_POST['realname']));
$apx->tmpl->assign('CITY', compatible_hsc($_POST['city']));
$apx->tmpl->assign('COUNTRY', compatible_hsc($_POST['country']));
$apx->tmpl->assign('PLZ', compatible_hsc($_POST['plz']));
$apx->tmpl->assign('INTERESTS', compatible_hsc($_POST['interests']));
$apx->tmpl->assign('WORK', compatible_hsc($_POST['work']));
$apx->tmpl->assign('GENDER', (int) $_POST['gender']);
$apx->tmpl->assign('BD_DAY', (int) $_POST['bd_day']);
$apx->tmpl->assign('BD_MON', (int) $_POST['bd_mon']);
$apx->tmpl->assign('BD_YEAR', (int) $_POST['bd_year']);
$apx->tmpl->assign('SIGNATURE', compatible_hsc($_POST['signature']));
$apx->tmpl->assign('MAXLEN', $set['user']['sigmaxlen']);
$apx->tmpl->assign('PUB_INVISIBLE', (int) $_POST['pub_invisible']);
//.........这里部分代码省略.........
示例4: boxes_go
function boxes_go()
{
global $list, $options, $fromaddr;
require_once CLASS_DIR . "mail.php";
$_POST["partSize"] = isset($_POST["partSize"]) & $_POST["split"] == "on" ? $_POST["partSize"] * 1024 * 1024 : FALSE;
$v_mails = explode("\n", $_POST['emails']);
$v_min = count(count($_POST["files"]) < count($v_mails) ? $_POST["files"] : $v_mails);
for ($i = 0; $i < $v_min; $i++) {
$file = $list[$_POST["files"][$i]];
$v_mail = trim($v_mails[$i]);
if (!checkmail($v_mail)) {
printf(lang(144), $v_mail);
echo "<br /><br />";
} elseif (file_exists($file["name"])) {
if (xmail("{$fromaddr}", $v_mail, "File " . basename($file["name"]), "File: " . basename($file["name"]) . "\r\n" . "Link: " . $file["link"] . ($file["comment"] ? "\r\nComments: " . str_replace("\\r\\n", "\r\n", $file["comment"]) : ""), $file["name"], $_POST["partSize"], $_POST["method"])) {
if ($_POST["del_ok"] && !$options['disable_deleting']) {
if (@unlink($file["name"])) {
$v_ads = " and deleted!";
unset($list[$_POST["files"][$i]]);
} else {
$v_ads = ", but <b>not</b> deleted!</b>";
}
} else {
$v_ads = " !";
}
echo '<script type="text/javascript">' . "mail('File <b>" . basename($file["name"]) . "</b> it is sent for the address <b>" . $v_mail . "</b>" . $v_ads . "', '" . md5(basename($file["name"])) . "');</script>\r\n<br />";
} else {
echo lang(12) . "<br />";
}
} else {
printf(lang(145), $file['name']);
echo "<br /><br />";
}
}
if (count($_POST["files"]) < count($v_mails)) {
for ($i = count($_POST["files"]); $i < count($v_mails); $i++) {
$v_mail = trim($v_mails[$i]);
echo "{$v_mail}.</b><br /><br />";
}
echo "</b><br />";
} elseif (count($_POST["files"]) > count($v_mails)) {
for ($i = count($v_mails); $i < count($_POST["files"]); $i++) {
$file = $list[$_POST["files"][$i]];
if (file_exists($file["name"])) {
echo $file["name"] . "<br /><br />";
} else {
printf(lang(145), $file['name']);
echo "<br /><br />";
}
}
echo "<br />";
}
if ($_POST["del_ok"]) {
if (!updateListInFile($list)) {
echo lang(146) . "<br /><br />";
}
}
}
示例5: opendir
if (count($argv) > 1) {
for ($i = 1; $i < count($argv); $i++) {
if (is_dir($argv[$i])) {
$dh = opendir($argv[$i]);
while ($fn = readdir($dh)) {
if (substr($fn, 0, 1) !== '.') {
$email = file_get_contents($argv[$i] . '/' . $fn);
print $argv[$i] . "/{$fn}\n";
checkmail($email);
}
}
closedir($dh);
} else {
$email = file_get_contents($argv[$i]);
print $argv[$i] . "\n";
checkmail($email);
}
}
} else {
$handle = fopen("php://stdin", "r");
$email = stream_get_contents($handle);
fclose($handle);
checkmail($email);
}
/**
* Now show the results
*/
foreach ($total as $t => $v) {
printf("%-15s %6d\n", $t, $v);
}
}
示例6: checkmail
<?php
// функция проверяет является ли строка адресом e-mail
require_once "settings.php";
function checkmail($string)
{
return preg_match('%[-\\.\\w]+@[-\\w]+(?:\\.[-\\w]+)+%', $string);
}
$link = mysql_connect(DBHOST, DBUSER, DBPASSWD) or die("Ошибка соединения: " . mysql_error());
//print "<b>Успешное подключение</b>";
mysql_select_db($DBNAME) or die("невозможно выполнить выборку из БД");
if (isset($_POST['email']) & checkmail($_POST['email']) & strlen($_POST['password']) >= 8) {
$email = @mysql_real_escape_string($_POST['email']);
$password = @mysql_real_escape_string($_POST['password']);
$query = "SELECT * FROM users WHERE email='{$email}' AND password='{$password}'";
$res = mysql_query($query) or trigger_error(mysql_error() . $query);
if ($row = mysql_fetch_assoc($res)) {
// начнём сессию и определим некоторые переменные
session_start();
$_SESSION['user_id'] = $row['user_id'];
$_SESSION['ip'] = $_SERVER['REMOTE_ADDR'];
}
header("Location: http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
exit;
}
if (isset($_GET['action']) and $_GET['action'] == "logout") {
session_start();
session_destroy();
header("Location: http://" . $_SERVER['HTTP_HOST'] . "/foronliner/listnonregister.php");
exit;
}
示例7: stripslashes
$mail = $user[reg_email];
} else {
$mail = $user[user_email];
}
if ($user[reg_email]) {
$sendmail->mail($email, stripslashes($mail_subject), stripslashes($mail_body), $mail_header);
}
}
eval("\$fail_newsletter = \"" . gettemplate("admin.done") . "\";");
}
#######################################
if ($adminaction == "edituser_save") {
### check entrys ####
if (!$form[user_login] || !$form[user_name] || !$form[reg_email]) {
eval("\$fail_useredit = \"" . gettemplate("fail.eingabe") . "\";");
} elseif (!checkmail($form[reg_email])) {
eval("\$fail_useredit =\"" . gettemplate("fail.eingabe.invalid.mail") . "\";");
} else {
if ($form[delete]) {
if ($userid != 1) {
$db->query_str("DELETE FROM {$tab['user']} WHERE id='{$userid}'");
} else {
$inc[action] = "GastAccount cannot be deleted.";
}
} else {
### SAVE QUERY ###
$date = time();
$query = $db->query_str("UPDATE {$tab['user']} SET \n\t\t\t\t\tuser_login='{$form['user_login']}',\n\t\t\t\t\tuser_name='{$form['user_name']}',\n\t\t\t\t\tuser_email='{$form['user_email']}',\n\t\t\t\t\tuser_location='{$form['user_location']}',\n\t\t\t\t\treg_email='{$form['reg_email']}',\n\t\t\t\t\tuser_icq='{$form['user_icq']}',\n\t\t\t\t\tuser_aim='{$form['user_aim']}',\n\t\t\t\t\tuser_yim='{$form['user_yim']}',\n\t\t\t\t\tuser_hp='{$form['user_hp']}',\n\t\t\t\t\tuser_interests='{$form['user_interests']}',\n\t\t\t\t\tuser_signatur='{$form['user_signatur']}',\n\t\t\t\t\tuser_text='{$form['user_text']}',\n\t\t\t\t\tuser_work='{$form['user_work']}',\n\t\t\t\t\tuser_gender='{$form['user_gender']}'\n\t\t\t\t\tWHERE id='{$userid}'");
}
$adminaction = "showusers";
}
示例8: trim
<?php
// Si on reçoit des infos du formulaire de changement de mail et qu'on a bien reçu un mail
if (isset($_POST['mail_change']) && $_POST['mail_change'] == 'ok' && isset($_POST['nouveau_mail'])) {
$nouveau_mail = trim($_POST['nouveau_mail']);
// On récupère le nouveau mail, en enlevant les caractères indésirables
$resultat_test_mail = checkmail($nouveau_mail, $bdd);
// On teste le mail envoyé
if ($resultat_test_mail == 'isnt') {
$erreur_pas_un_mail = 1;
} else {
if ($resultat_test_mail == 'exists') {
$erreur_deja_utilise = 1;
} else {
if ($resultat_test_mail == 'empty') {
$erreur_pas_de_mail = 1;
} else {
if ($resultat_test_mail == 'ok') {
// On enregistre le nouveau mail
$req = $bdd->prepare('UPDATE users
SET mail=?
WHERE id_user = ?');
$req->execute(array($nouveau_mail, $id_user));
$mail_modifie = 1;
}
}
}
}
}
// Si on reçoit des infos du formulaire de changement de MOT DE PASSE et qu'on a bien reçu un mdp
if (isset($_POST['mdp_change']) && $_POST['mdp_change'] == 'ok' && isset($_POST['nouveau_mdp']) && isset($_POST['verif_mdp'])) {
示例9: prepareforsave
function prepareforsave($string)
{
//$string = strip_tags($string);
//$string = nl2br($string);
return $string;
}
//print_r ($_POST);
if ($_POST['username'] == "") {
print "имя не введено<br>";
exit;
}
if ($_POST['mail'] == "") {
print "почта на указана";
exit;
}
if (!checkmail($_POST['mail'])) {
print "формат почты указан неверно";
exit;
}
if ($_POST['pass1'] == "") {
print "пароль не введён";
exit;
}
if (strlen($_POST['pass1']) < $passlen) {
print "длина пароля должна быть не менее {$passlen} символов";
exit;
}
if ($_POST['pass1'] != $_POST['pass2']) {
print "пароль и его подтверждение не совпадают";
exit;
}
示例10: add_mem
/** Creates a new hosted account
*
* Creates a new hosted account (in the tables <code>membres</code>
* and <code>local</code>). Prevents any manipulation of the account if
* the account $mid is not super-admin.
*
*
* @global m_err $err
* @global m_quota $quota
* @global array $classes
* @global int $cuid
* @global m_mem $mem
* @global string $L_MYSQL_DATABASE
* @global string $L_MYSQL_LOGIN
* @global m_hooks $hooks
* @global m_action $action
* @param string $login Login name like [a-z][a-z0-9]*
* @param string $pass Password (max. 64 characters)
* @param string $nom Name of the account owner
* @param string $prenom First name of the account owner
* @param string $mail Email address of the account owner, useful to get
* one's lost password
* @param integer $canpass
* @param string $type Account type for quotas
* @param int $duration
* @param string $notes
* @param integer $force
* @param string $create_dom
* @param int $db_server_id
* @return boolean Returns FALSE if an error occurs, TRUE if not.
*/
function add_mem($login, $pass, $nom, $prenom, $mail, $canpass = 1, $type = 'default', $duration = 0, $notes = "", $force = 0, $create_dom = '', $db_server_id)
{
global $err, $quota, $classes, $cuid, $mem, $L_MYSQL_DATABASE, $L_MYSQL_LOGIN, $hooks, $action;
$err->log("admin", "add_mem", $login . "/" . $mail);
if (!$this->enabled) {
$err->raise("admin", _("-- Only administrators can access this page! --"));
return false;
}
if (empty($db_server_id)) {
$err->raise("admin", _("Missing db_server field"));
return false;
}
if ($login == "" || $pass == "") {
$err->raise("admin", _("All fields are mandatory"));
return false;
}
if (!$force) {
if ($mail == "") {
$err->raise("admin", _("All fields are mandatory"));
return false;
}
//@todo remove cf functions.php
if (checkmail($mail) != 0) {
$err->raise("admin", _("Please enter a valid email address"));
return false;
}
}
$login = strtolower($login);
if (!preg_match("#^[a-z0-9]+\$#", $login)) {
//$
$err->raise("admin", _("Login can only contains characters a-z and 0-9"));
return false;
}
if (strlen($login) > 14) {
// Not an arbitrary value : MySQL user names can be up to 16 characters long
// If we want to allow people to create a few mysql_user (and we want to!)
// we have to limit the login lenght
$err->raise("admin", _("The login is too long (14 chars max)"));
return false;
}
// Some login are not allowed...
if ($login == $L_MYSQL_DATABASE || $login == $L_MYSQL_LOGIN || $login == "mysql" || $login == "root") {
$err->raise("admin", _("Login can only contains characters a-z, 0-9 and -"));
return false;
}
$pass = _md5cr($pass);
$db = new DB_System();
$notes = mysql_real_escape_string($notes);
// Already exist?
$db->query("SELECT count(*) AS cnt FROM membres WHERE login='{$login}';");
$db->next_record();
if (!$db->f("cnt")) {
$db->query("SELECT max(m.uid)+1 as nextid FROM membres m");
if (!$db->next_record()) {
$uid = 2000;
} else {
$uid = $db->Record["nextid"];
if ($uid <= 2000) {
$uid = 2000;
}
}
$db->query("INSERT INTO membres (uid,login,pass,mail,creator,canpass,type,created,notes,db_server_id) VALUES ('{$uid}','{$login}','{$pass}','{$mail}','{$cuid}','{$canpass}', '{$type}', NOW(), '{$notes}', '{$db_server_id}');");
$db->query("INSERT INTO local(uid,nom,prenom) VALUES('{$uid}','{$nom}','{$prenom}');");
$this->renew_update($uid, $duration);
#exec("sudo /usr/lib/alternc/mem_add ".$login." ".$uid);
$action->create_dir(getuserpath("{$login}"));
$action->fix_user($uid);
// Triggering hooks
$mem->su($uid);
//.........这里部分代码省略.........
示例11: time
$_POST['userid'] = 0;
}
$_POST['file'] = $_FILES['file']['name'];
$_POST['tempfile'] = 'downloads/uploads/' . $stamp . '-' . $_FILES['file']['name'];
$_POST['addtime'] = time();
$_POST['send_ip'] = get_remoteaddr();
$_POST['local'] = 1;
$_POST['secid'] = 'all';
$_POST['text'] = strtr(strip_tags($_POST['text']), array("\r\n" => "<br />\r\n", "\n" => "<br />\n"));
if ($set['downloads']['coms']) {
$_POST['allowcoms'] = 1;
}
if ($set['downloads']['ratings']) {
$_POST['allowrating'] = 1;
}
if (checkmail($_POST['author_link'])) {
$_POST['author_link'] = 'mailto:' . $_POST['author_link'];
}
//eMail-Benachrichtigung
if ($set['downloads']['mailonnew']) {
$input = array('URL' => HTTP);
sendmail($set['downloads']['mailonnew'], 'SENDDOWNLOAD', $input);
}
//Captcha löschen
if ($set['downloads']['captcha'] && !$user->info['userid']) {
$captcha->remove();
}
$db->dinsert(PRE . '_downloads', 'userid,secid,catid,send_username,send_email,send_ip,file,tempfile,local,title,text,author,author_link,addtime,allowcoms,allowrating');
message($apx->lang->get('MSG_OK'), mklink('downloads.php', 'downloads.html'));
}
//SCRIPT BEENDEN
示例12: die
// Vérification que c'est bien une image
if (!$image->isImage()) {
die('image non trouvée');
}
function checkmail($mail)
{
if (eregi("^[0-9a-z]([-_.~]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,4}\$", $mail)) {
return true;
} else {
return false;
}
}
if (!checkmail($_REQUEST['from_email'])) {
die("L'adresse email de l'expéditeur n'est pas valide, utilisez le bouton précédent pour la corriger");
}
if (!checkmail($_REQUEST['to_email'])) {
die("L'adresse email du destinataire n'est pas valide, utilisez le bouton précédent pour la corriger");
}
if (empty($_REQUEST['message'])) {
die("Le message est vide, utilisez le bouton précédent pour la corriger");
}
// sauvegarde du formulaire dans session
$_SESSION['ecard']['from_email'] = $_REQUEST['from_email'];
$_SESSION['ecard']['from_name'] = $_REQUEST['from_name'];
$_SESSION['ecard']['to_email'] = $_REQUEST['to_email'];
$_SESSION['ecard']['message'] = $_REQUEST['message'];
$_SESSION['ecard']['message'] = str_replace("\n", '', $_SESSION['ecard']['message']);
$_SESSION['ecard']['message'] = str_replace("\r", '', $_SESSION['ecard']['message']);
/*
echo '<pre>';
print_r($_SESSION['ecard']);
示例13: checkmail
function checkmail($user_email)
{
//验证电子邮件地址
if (preg_match("/\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*/", $user_email)) {
return true;
} else {
return false;
}
}
if (get_argp("user_name") == NULL) {
action_return(0, $re_langpackage->re_empty_name, "-1");
}
if (!login_check(get_argp("user_name"))) {
action_return(0, $re_langpackage->re_right_name, "-1");
}
if (!checkmail(get_argp("user_email")) || !login_check(get_argp("user_email"))) {
action_return(0, $re_langpackage->re_right_email, "-1");
}
if (strlen(get_argp("user_repassword")) < 6) {
action_return(0, $re_langpackage->re_pass_limit, "-1");
}
$user_name = short_check(get_argp("user_name"));
$user_pws = md5(get_argp("user_password"));
$user_sex = intval(get_argp("user_sex"));
$user_email = short_check(get_argp("user_email"));
$is_pass = 1;
$user_vericode = get_argp("veriCode");
$invite_fromuid = 0;
if (get_session('InviteFromUid')) {
$invite_fromuid = get_session('InviteFromUid');
}
示例14: foreach
require_once 'functions.php';
$valid = TRUE;
if (isset($_POST['submit'])) {
foreach ($_POST as $key => $value) {
${$key} = $value;
}
$valid = $fn = checklength($fname, 1, 30);
$ln = checklength($lname, 1, 30);
$valid = $valid && $ln;
$em = checkemail($email);
$valid = $valid && $em;
$ps = checkpassword($password);
$valid = $valid && $ps;
$ps2 = $password == $password2;
$valid = $valid && $ps2;
$zp = checkmail($zipcode, 'US');
$valid = $valid && $zp;
if ($valid) {
echo "form filled successfully!";
exit;
}
} else {
$fn = $ln = $em = $ps = $ps2 = $hp = $zp = TRUE;
$fname = $lname = $email = $zipcode = $omepage = "";
}
if (!$valid) {
?>
<style type="text/css">
td.error
{
color:#F00;
示例15: date
$yetki = $_POST["yetki"];
$tarih = date("y-m-d");
if ($kullanici_adi == "" or $parola == "" or $parolatekrar == "" or $eposta == "" or $yetki == "" or $adi == "") {
echo "<center><i class='fa fa-frown-o'></i> Lütfen tüm alanları eksiksiz doldurun!</center>";
header("Refresh: 2; url=index.php?sayfa=uyeekle");
return;
} elseif ($parola != $parolatekrar) {
echo "<center><i class='fa fa-frown-o'></i> Parola ve Parola Tekrar alanları aynı olmalı!</center>";
header("Refresh: 2; url=index.php?sayfa=uyeekle");
return;
}
function checkmail($eposta)
{
return filter_var($eposta, FILTER_VALIDATE_EMAIL);
}
if (!checkmail($eposta)) {
echo "<center><i class='fa fa-frown-o'></i> Yazdığınız e-posta adresi geçersiz!</center>";
header("Refresh: 2; url=index.php?sayfa=uyeekle");
return;
}
$isim_kontrol = mysql_query("select * from tlg_uyeler where k_adi='" . $kullanici_adi . "'") or die(mysql_error());
$uye_varmi = mysql_num_rows($isim_kontrol);
if ($uye_varmi > 0) {
echo "<center><i class='fa fa-frown-o'></i> Kullanıcı adı başka bir üye tarafından kullanılıyor!</center>";
header("Refresh: 2; url=index.php?sayfa=uyeekle");
return;
}
$eposta_kontrol = mysql_query("select * from tlg_uyeler where eposta='" . $eposta . "'") or die(mysql_error());
$eposta_varmi = mysql_num_rows($eposta_kontrol);
if ($eposta_varmi > 0) {
echo "<center><i class='fa fa-frown-o'></i> E-Posta başka bir üye tarafından kullanılıyor!</center>";