function send($email, $code) { $sendmail = new sendmail(); $mail = new mail(); $mail->setSmtpemailto($email); $mail->setMailsubject("邮箱验证"); $mail->setMailbody("感谢你的支持,你的验证码为:" . $code); $rs = $sendmail->send($mail); return $rs; }
<?php //include (dirname(__FILE__).'/config/cronconfig.php'); include '/home/jobbid/public_html/config/cronconfig.php'; include ROOT . DS . 'library' . DS . 'dataprovider.php'; include ROOT . DS . 'library' . DS . 'sendmail.php'; $conn = new DataProvider(); $data = $conn->getEmailSpam(); if (!empty($data)) { $mail = new sendmail(); $secSenders = $conn->get_cache('secSenders'); $lenSecSenders = count($secSenders); $content = $conn->get10NewProject(); $arrTo = array(); foreach ($data as $e) { array_push($arrTo, $e->email); } try { $flag = true; while ($flag) { $rand = mt_rand(0, $lenSecSenders - 1); $sender = $secSenders[$rand]; if ($sender == null) { $mail->send(ADMIN_EMAIL, 'SMTP Error!!!', 'No email sender', $emailGlobal); $flag = false; } else { if ($mail->send($arrTo, 'JobBid.vn - Danh Sách Công Việc Bán Thời Gian Mới!!!', $content, $sender) == false) { unset($secSenders[$rand]); $secSenders = array_values($secSenders); $lenSecSenders--; $conn->set_cache('secSenders', $secSenders);
<?php //include ('/home/jobbid/public_html/library/dataprovider.php'); //include ('/home/jobbid/public_html/library/sendmail.php'); include '/home/jobbid/public_html/config/cronconfig.php'; include ROOT . DS . 'library' . DS . 'dataprovider.php'; include ROOT . DS . 'library' . DS . 'sendmail.php'; $conn = new DataProvider(); $data = $conn->getListSendmail(); if (!empty($data)) { $mail = new sendmail(); $arr = array(); $priSenders = $conn->get_cache('priSenders'); $secSenders = $conn->get_cache('secSenders'); $lenPriSenders = count($priSenders); $lenSecSenders = count($secSenders); $rand = mt_rand(0, $lenPriSenders - 1); $sender1 = $priSenders[$rand]; $rand = mt_rand(0, $lenSecSenders - 1); $sender2 = $secSenders[$rand]; $emailGlobal = array('email' => GLOBAL_EMAIL, 'password' => GLOBAL_PASS, 'smtp' => GLOBAL_SMTP, 'port' => GLOBAL_PORT); foreach ($data as $e) { try { $flag = true; while ($flag) { $sender = $sender1; if ($e->isprior != 1) { $sender = $sender2; } if ($sender == null) { $mail->send(ADMIN_EMAIL, 'SMTP Error!!!', 'No email sender', $emailGlobal);
$is_chatroom = $mode == "chatroom"; if ($is_chatroom) { $name = "chatroom conversation"; } else { $name = "Conversation with " . $to_name; } $lines = '-----------------------------------------------------------'; //$path = "tmp/".$name.".txt"; if ($is_chatroom) { $query = "SELECT DISTINCT * FROM frei_chat WHERE room_id=? AND message_type=1 order by time DESC"; $arr = array($to_id); } else { $query = "SELECT * FROM frei_chat WHERE (frei_chat.\"to\"=? AND frei_chat.\"from\"=?) OR (frei_chat.\"from\"=? AND frei_chat.\"to\"=?) ORDER BY time"; $arr = array($frm_id, $to_id, $frm_id, $to_id); } $this->ISmesGquery = $this->db->prepare($query); $this->ISmesGquery->execute($arr); $messages = $this->ISmesGquery->fetchAll(); $contents = "Conversation: \n\n"; foreach ($messages as $message) { $contents .= $message['from_name'] . ": " . str_replace("\\'", "'", $message['message']) . " \n"; } $prime = $name . "\n" . $lines . "\n\n"; $complete_contents = $prime . str_replace(",", ",", $contents); $complete_contents = strip_tags($complete_contents); $filename = $name . ".txt"; return $complete_contents; } } $sendmail = new sendmail(); $sendmail->sendmail();
function doSendActiveCode() { try { $this->updateStatistics(); if (!isset($_SESSION['sendactivecode'])) { $_SESSION['sendactivecode'] = 0; } if ($_SESSION['sendactivecode'] >= MAX_SENDACTIVECODE) { die('ERROR_MANYTIMES'); } $this->checkLogin(true); $account_id = $_SESSION['account']['id']; $username = $_SESSION['account']['username']; $this->setModel('activecode'); $this->activecode->where(" and account_id={$account_id}"); $data = $this->activecode->search('active_code'); if (empty($data)) { die('ERROR_SYSTEM'); } $active_code = $data[0]['activecode']['active_code']; //Send mail $linkactive = BASE_PATH . "/webmaster/doActive/true&account_id={$account_id}&active_code={$active_code}"; global $cache; $content = $cache->get('mail_verify'); $search = array('#LINKACTIVE#', '#ACTIVECODE#', '#USERNAME#'); $replace = array($linkactive, $active_code, $username); $content = str_replace($search, $replace, $content); $priSenders = $cache->get('priSenders'); $sender = $priSenders[mt_rand(0, count($priSenders) - 1)]; include ROOT . DS . 'library' . DS . 'sendmail.php'; $mail = new sendmail(); $mail->send($username, 'JobBid.vn - Mail Xác Nhận Đăng Ký Tài Khoản!', $content, $sender); $_SESSION['sendactivecode'] = $_SESSION['sendactivecode'] + 1; echo 'DONE'; } catch (Exception $e) { echo 'ERROR_SYSTEM'; } }
header('HTTP/1.1 401 Unauthorized', true, 401); header('Content-Type: text/plain; charset=utf-8'); die("You have not purchased or installed that app.\n"); } switch ($_POST['item']) { case 'feedback': $body = <<<BODY {$LOGIN_DATA['nickname']} has sent you {$_POST['item']} feedback about your app "{$package['name']}" version {$_POST['version']}. They are using {$_POST['os']} (platform: {$_POST['platform']}) version {$_POST['osVersion']} on {$_POST['machine']}. {$_POST['body']} BODY; require dirname(__FILE__) . '/../include/emailclass.php'; if ($package['developer_public_key']) { $mail = new sendmail(); $mail->gpg_add_key("0x{$package['developer_public_key']}"); $mail->gpg_set_type(GPG_ASYMMETRIC); $mail->gpg_set_sign(1); } else { $mail = new sendmail_gpgsign(); } $mail->gpg_set_signing_key('0x0DD626E6'); // Verifies it was sent by our server $mail->gpg_set_homedir('/home/apt/.gnupg/'); $mail->sender("*****@*****.**"); $mail->from('"' . $LOGIN_DATA['nickname'] . '" <' . $LOGIN_DATA['email'] . '>'); $mail->add_to($package['developer_email']); $mail->subject("[TVE] {$_POST['type']} feedback for {$package['package']}"); $mail->body($body); if ($mail->send()) {
function resetpassword() { try { if (!isset($_GET['username'])) { die('ERROR_SYSTEM'); } if (!isset($_SESSION['sendresetpass'])) { $_SESSION['sendresetpass'] = 0; } if ($_SESSION['sendresetpass'] >= MAX_SENDRESETPASS) { die('ERROR_MANYTIMES'); } $username = $_GET['username']; if ($username == null) { die('ERROR_SYSTEM'); } $username = mysql_real_escape_string($username); $this->account->where(" and active>=0 and username='******'"); $data = $this->account->search('id'); if (empty($data)) { die('ERROR_NOTEXIST'); } $account_id = $data[0]['account']['id']; $this->setModel('resetpassword'); $this->resetpassword->where(" and account_id={$account_id}"); $data = $this->resetpassword->search('id,times'); $verify = genString(); if (!empty($data)) { //da gui reset password truoc day $times = $data[0]['resetpassword']['times'] + 1; if ($times > MAX_TIMESRESETPASS) { die('ERROR_LOCKED'); } $this->resetpassword->id = $data[0]['resetpassword']['id']; $this->resetpassword->times = $times; $this->resetpassword->verify = $verify; $this->resetpassword->update(); } else { //gui reset password lan dau tien $this->resetpassword->id = null; $this->resetpassword->account_id = $account_id; $this->resetpassword->times = 1; $this->resetpassword->verify = $verify; $this->resetpassword->insert(); } //Send mail url : /webmaster/changepass/resetpassword_id/resetpassword_verify $linkresetpass = BASE_PATH . "/webmaster/changepass/{$account_id}/{$verify}"; $linkresetpass = "******"; global $cache; $content = $cache->get('mail_resetpass'); $search = array('#RESETPASSLINK#'); $replace = array($linkresetpass); $content = str_replace($search, $replace, $content); $priSenders = $cache->get('priSenders'); $sender = $priSenders[mt_rand(0, count($priSenders) - 1)]; include ROOT . DS . 'library' . DS . 'sendmail.php'; $mail = new sendmail(); $mail->send($username, 'JobBid.vn - Mail Xác Nhận Khôi Phục Mật Khẩu Đăng Nhập!', $content, $sender); $_SESSION['sendresetpass'] = $_SESSION['sendresetpass'] + 1; echo 'DONE'; } catch (Exception $e) { echo 'ERROR_SYSTEM'; } }
<?php ini_set('date.timezone', 'PRC'); require_once "./sendmail.php"; function wiz($start, $end) { for ($i = $start; $i <= $end; $i++) { $url = "http://www.qiushibaike.com/hot/page/" . $i; $opts = array('http' => array('method' => "GET", 'header' => "User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)\r\n" . "\r\n")); $cxContext = stream_context_create($opts); $html = file_get_contents($url, false, $cxContext); preg_match_all("/<div class=\"content\">\n*(.*)\n*.*\n*<\\/div>/", $html, $matches); $mat[$i] = '<h3>第' . $i . '页</h3><hr><hr>' . implode('<hr>', $matches[1]); var_dump("第 {$i} 页"); } return implode('<hr>', $mat); } $content = '<meta charset="utf-8">' . wiz(30, 40); $mail = new sendmail(); $res = $mail->send('*****@*****.**', iconv("UTF-8", "GB2312", '糗事百科'), $content); var_dump($res);
function doAddMoiThau($account_id = null, $duan_id = null) { if ($duan_id == null || $account_id == null) { die('ERROR_SYSTEM'); } try { $this->checkLogin(true); $this->checkActive(true); $this->checkLock(true); $this->setModel('moithau'); $employer_id = $_SESSION['account']['id']; $account_id = mysql_real_escape_string($account_id); $duan_id = mysql_real_escape_string($duan_id); $this->nhathau->showHasOne(array('account')); $this->nhathau->where(" and `status`=1 and account_id={$account_id}"); $data = $this->nhathau->search('nhathau.id,username'); if (empty($data)) { die('ERROR_SYSTEM'); } $email = $data[0]['account']['username']; $this->setModel('duan'); $this->duan->showHasOne(array('linhvuc')); $this->duan->id = $duan_id; $this->duan->where(" and duan.active=1 and approve = 1 and duan.nhathau_id is null and ngayketthuc>now() and account_id={$employer_id}"); $data = $this->duan->search('duan.id,tenduan,costmax,costmin,tenlinhvuc'); if (empty($data)) { die('ERROR_SYSTEM'); } $chiphi = formatMoney($data["duan"]["costmin"]) . ' đến ' . formatMoney($data["duan"]["costmax"]); $linkmoithau = BASE_PATH . '/moithau/viewMyLetters'; $linkmoithau = "<a href='{$linkmoithau}'>{$linkmoithau}</a>"; global $cache; $content = $cache->get('mail_moithau'); $search = array('#TENDUAN#', '#CHIPHI#', '#LINHVUC#', '#LINKMOITHAU#'); $replace = array($data['duan']['tenduan'], $chiphi, $data['linhvuc']['tenlinhvuc'], $linkmoithau); $content = str_replace($search, $replace, $content); $this->setModel('moithau'); $this->moithau->where(" and duan_id={$duan_id} and account_id={$account_id}"); $data = $this->moithau->search('id'); if (!empty($data)) { die('ERROR_INVITED'); } $this->moithau->id = null; $this->moithau->account_id = $account_id; $this->moithau->duan_id = $duan_id; $this->moithau->time = GetDateSQL(); $this->moithau->hadread = 0; $this->moithau->insert(); //Gui mail_moithau $priSenders = $cache->get('priSenders'); $sender = $priSenders[mt_rand(0, count($priSenders) - 1)]; include ROOT . DS . 'library' . DS . 'sendmail.php'; $mail = new sendmail(); $mail->send($email, 'Bạn Được Mời Thầu 1 Dự Án Trên JobBid.vn!', $content, $sender); echo 'DONE'; } catch (Exception $e) { echo 'ERROR_SYSTEM'; } }
<?php include_once './lib.php'; include_once './config.php'; if (!isPostBack()) { die('Please send contact form via POST method...'); } $Name = htmlspecialchars($_POST['txtName']); $Email = htmlspecialchars($_POST['txtEmail']); $Subject = htmlspecialchars($_POST['txtSubject']); $preText = "<strong>Sender Name:</strong> {$Name} <br />"; $preText .= "<strong>Sender Email:</strong> {$Email} <br />"; $preText .= "<strong>Subject:</strong> {$Subject} <br /><br />"; $Text = htmlspecialchars($_POST['txtText']); $Text = $preText . $Text; if (empty($Text)) { die('Text could not be empty...'); } if (!checkEmailAddress($Email)) { die('Invalid email address...'); } if (!sendmail::send($Email, $contactEmail, $Text, $Subject)) { die('Could not send message. failed to connect to mailserver.'); } echo '1';
<?php require_once dirname(__FILE__) . '/../include/use_type.php'; require_once dirname(__FILE__) . '/../include/check_method.php'; require dirname(__FILE__) . '/../include/processCookie.php'; if ($LOGIN_DATA['user_id'] && check_method(array('GET', 'POST')) == 'POST') { $successful_submit = false; if ($_POST['name'] && $_POST['price'] && $_POST['source_license'] && $_POST['content_license'] && ($_POST['source_file'] || $_POST['source_control'])) { require dirname(__FILE__) . '/../include/emailclass.php'; $mail = new sendmail(); $mail->gpg_add_key('0x0DD626E6'); $mail->gpg_set_type(GPG_ASYMMETRIC); $mail->gpg_set_sign(1); $mail->gpg_set_signing_key('0x0DD626E6'); $mail->gpg_set_homedir('/home/apt/.gnupg/'); $mail->sender("*****@*****.**"); $mail->from($LOGIN_DATA['email']); $mail->add_to('*****@*****.**'); $mail->subject('TVE Application Submission: ' . $_POST['name']); if ($_FILES['source_file']) { $mail->attachment($_FILES['source_file']['tmp_name'], $_FILES['source_file']['type'], $_FILES['source_file']['name']); } foreach ($_POST as $key => $val) { if ($key == 'source_file') { continue; } $mail->body($key . ': ' . $val . "\n"); } $mail->body('User: '******'user_id']); $successful_submit = $mail->send(); }
function sendTest($isPre = 0) { $this->checkAdmin(true); try { $validate = new Validate(); $email = ''; $password = ''; $smtp = ''; $port = ''; if ($isPre == 1) { if ($validate->check_submit(1, array("primary_email", "primary_password", "primary_smtp", "primary_port")) == false) { die('ERROR_SYSTEM'); } $email = $_POST['primary_email']; $password = $_POST['primary_password']; $smtp = $_POST['primary_smtp']; $port = $_POST['primary_port']; } else { if ($validate->check_submit(1, array("second_email", "second_password", "second_smtp", "second_port")) == false) { die('ERROR_SYSTEM'); } $email = $_POST['second_email']; $password = $_POST['second_password']; $smtp = $_POST['second_smtp']; $port = $_POST['second_port']; } $sender = array("email" => $email, 'password' => $password, 'smtp' => $smtp, 'port' => $port); include ROOT . DS . 'library' . DS . 'sendmail.php'; $mail = new sendmail(); $mail->send(EMAIL_TEST, 'JobBid.vn - Mail Thử Nghiệm!', 'Xin chào bạn, chúng tôi là mạng freelancer!', $sender); echo 'DONE'; } catch (Exception $e) { //echo 'Caught exception: ', $e->getMessage(), "\n"; echo 'ERROR_SYSTEM'; } }
<?php require_once "./sendmail.php"; //使い方のサンプル $mail = new sendmail("./test.tmpl"); //テンプレートファイルを指定 $mail->set_to("*****@*****.**"); //To $mail->set_from("*****@*****.**"); //From $mail->set_title("Mail_Title"); //タイトル //テンプレートで置換する文字列を指定します。 $tmp = array("aaa" => "置換さてた文字"); $mail->send($tmp); //メール送信!
function submit_dang_tin_rao_vat() { try { $max_raovat = isset($_SESSION['MAX_RAOVAT']) ? $_SESSION['MAX_RAOVAT'] : 0; if ($max_raovat >= MAX_RAOVAT) { die('MAX_RAOVAT'); } $tieude = $_POST['raovat_tieude']; $alias = $_POST['raovat_alias']; $email = $_POST['raovat_email']; $sodienthoai = $_POST['raovat_sodienthoai']; $noidung = $_POST['raovat_noidung']; $validate = new Validate(); if ($validate->check_submit(1, array('raovat_email', 'raovat_sodienthoai', 'raovat_tieude', 'raovat_alias', 'raovat_noidung')) == false) { die('ERROR_SYSTEM'); } if ($validate->check_null(array($email, $sodienthoai, $tieude, $noidung)) == false) { die('ERROR_SYSTEM'); } if ($validate->check_length($tieude, 101)) { die('ERROR_SYSTEM'); } if (!$validate->check_email($email)) { die('ERROR_SYSTEM'); } $account_id = null; global $cache; $status = 0; if (isset($_SESSION['account'])) { $account_id = $_SESSION['account']['id']; $status = 1; } else { $this->setModel('account'); $strWhere = "AND username='******'"; $this->account->where($strWhere); $data2 = $this->account->search('id'); if (!empty($data2)) { die('ERROR_EXIST'); } $this->account->id = null; $this->account->username = $email; $this->account->timeonline = 0; $this->account->role = 2; $this->account->active = 0; $account_id = $this->account->insert(true); $this->account->id = $account_id; $data2 = $this->account->search(); $_SESSION['account'] = $data2['account']; $active_code = genString(); $this->setModel('activecode'); $this->activecode->id = null; $this->activecode->account_id = $account_id; $this->activecode->active_code = $active_code; $this->activecode->insert(); //Send active code $linkactive = BASE_PATH . "/webmaster/doActive/true&account_id={$account_id}&active_code={$active_code}"; $linkactive = "<a href='{$linkactive}'>{$linkactive}</a>"; $content = $cache->get('mail_verify'); $search = array('#LINKACTIVE#', '#ACTIVECODE#', '#USERNAME#'); $replace = array($linkactive, $active_code, $email); $content = str_replace($search, $replace, $content); $priSenders = $cache->get('priSenders'); $sender = $priSenders[mt_rand(0, count($priSenders) - 1)]; include ROOT . DS . 'library' . DS . 'sendmail.php'; $mail = new sendmail(); $mail->send($email, 'JobBid.vn - Mail Xác Nhận Đăng Ký Tài Khoản!', $content, $sender); } $this->setModel('raovat'); $this->raovat->id = null; $this->raovat->raovat_email = $email; $this->raovat->raovat_sodienthoai = $sodienthoai; $this->raovat->noidung = $noidung; $this->raovat->tieude = $tieude; $this->raovat->alias = $alias; $currentDate = GetDateSQL(); $this->raovat->ngaypost = $currentDate; $this->raovat->ngayupdate = $currentDate; $this->raovat->views = 0; $this->raovat->account_id = $account_id; $this->raovat->status = $status; $this->raovat->insert(); $this->updatecache(); $max_raovat++; $_SESSION['MAX_RAOVAT'] = $max_raovat; if (isset($_SESSION['account'])) { if ($_SESSION['account']['active'] == 1) { echo 'OK'; } else { echo 'NOT_ACTIVE'; } } else { echo 'NOT_ACTIVE'; } } catch (Exception $e) { echo 'ERROR_SYSTEM'; } }
public function actionWriteindex() { $model = new mail(); if ($model->load(Yii::$app->request->post()) && $model->validate()) { error_reporting(E_ALL ^ E_WARNING); $request = Yii::$app->request; $body = $request->post(); $to = $model->receiver; // $text=$model->text; $subject = $model->subject; // $body = $model->body; print_r($model); $mail = new sendmail(); //新建发送 $mail->setServer("smtp.126.com", "tclrg", "Luanruitest"); $mail->setFrom("*****@*****.**"); $mail->setReceiver("{$to}"); $mail->setMailInfo($subject, $body['body'], false, NULL); $mail->sendMail(); return $this->render('/Users\\dealer\\write', ['model' => $model]); } else { //print_r($model); return $this->render('/Users\\dealer\\write', ['model' => $model]); } }
function permission($id = null, $editcode = null, $answer = 0) { if ($id == null || $editcode == null) { error('Liên kết không hợp lệ!'); } $editcode = mysql_real_escape_string($editcode); $this->duan->showHasOne(array('account')); $this->duan->id = $id; $this->duan->where(" and editcode='{$editcode}'"); $data = $this->duan->search('tenduan,alias,duan_email,duan.active,duan_sodienthoai,username,thongtinchitiet'); if (empty($data)) { error('Liên kết không hợp lệ!'); } if ($answer == 0) { $this->duan->id = $id; $this->duan->delete(); success('Đã xóa thông tin công việc này, xin lỗi vì đã làm phiền bạn!'); } else { if ($data['duan']['active'] == 1) { error('Công việc này đã được xác nhận rồi!'); } $emailEmployer = $data['duan']['duan_email']; $email = $data['account']['username']; $tenduan = $data['duan']['tenduan']; $alias = $data['duan']['alias']; $sodienthoai = $data['duan']['duan_sodienthoai']; $thongtinchitiet = $data['duan']['thongtinchitiet']; $this->duan->id = $id; $currentDate = GetDateSQL(); $this->duan->timeupdate = $currentDate; $this->duan->active = 1; $this->duan->update(); $myprojects = array(); if (isset($_SESSION['myprojects'])) { $myprojects = $_SESSION['myprojects']; } if (in_array($id, $myprojects) == false) { array_push($myprojects, $id); $_SESSION['myprojects'] = $myprojects; } global $cache; include ROOT . DS . 'library' . DS . 'sendmail.php'; $priSenders = $cache->get('priSenders'); $sender = $priSenders[mt_rand(0, count($priSenders) - 1)]; //Send approve email to admin $linkview = BASE_PATH . "/duan/view/{$id}/{$alias}"; $linkview = "<a href='{$linkview}'>{$linkview}</a>"; $linkdongy = BASE_PATH . "/duan/approve/{$id}/{$editcode}/1"; $linkdongy = "<a href='{$linkdongy}'><font color='green'>ĐỒNG Ý</font></a>"; $linkodongy = BASE_PATH . "/duan/approve/{$id}/{$editcode}/0"; $linkodongy = "<a href='{$linkodongy}'><font color='red'>KHÔNG ĐỒNG Ý</font></a>"; $content = $cache->get('mail_approve'); $search = array('#TENDUAN#', '#EMAIL1#', '#EMAIL#', '#SDT#', '#THONGTINCHITIET#', '#LINK#', '#DONGY#', '#KHONGDONGY#'); $replace = array($tenduan, $email, $emailEmployer, $sodienthoai, $thongtinchitiet, $linkview, $linkdongy, $linkodongy); $content = str_replace($search, $replace, $content); $mail = new sendmail(); $mail->send(GLOBAL_EMAIL, 'Hệ Thống - Email Approve Dự Án Mới!', $content, $sender); $this->set('linkview', $linkview); $this->set('title', "Bạn đã xác nhận đồng ý đăng công việc lên JobBid.vn!"); $this->_template->render(); } }
function show($final) { if ($final['id'] == "1") { echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"用户名和密码不能为空!\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/index.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "2") { echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"用户名或密码错误!请重试!\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/index.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "3") { $_SESSION['user'] = "******"; echo "<script language=\"JavaScript\">\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/view/index.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "4") { echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"两次密码输入不相同,请重试!\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/view/insert.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "5") { echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"请完善表单,再注册!\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/view/insert.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "6") { echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"密码必须是6~10位数字\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/view/insert.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "7") { echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"用户名已经存在!\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/view/insert.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "8") { require_once '../model/sendmail.php'; $checknum = $final; $send = new sendmail(); $send->sendout($checknum); echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"注册成功!请登录邮箱以激活!\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/index.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "9") { echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"邮箱格式不正确!\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/view/insert.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "10") { echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"验证成功!\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/index.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "11") { echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"验证失败,请重试!\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/index.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "12") { echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"邮箱未验证,请验证后再登录!\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/index.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "13") { echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"用户昵称长度超过10字节!请重试!\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/view/insert.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "14") { echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"验证码错误!请重试!\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/index.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "15") { echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"验证码错误!请重试!\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/view/insert.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "16") { echo "邮箱不能为空!"; exit; } else { if ($final['id'] == "17") { echo "邮箱不存在!!"; exit; } else { if ($final['id'] == "18") { require_once '../model/sendfind.php'; $checknum = $final; $send = new sendfind(); $send->sendout($checknum); echo "done"; exit; } else { if ($final['id'] == "19") { echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"验证码为空!请重试!\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/view/findback.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "20") { echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"验证码错误!请重试!\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/view/findback.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "21") { $_SESSION['user'] = '******'; echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"验证成功!\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/view/reset.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "22") { echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"请填写要修改的昵称或者密码!\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/view/update.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "23") { echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"两次输入密码不同,请重试!\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/view/update.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "24") { echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"密码长度必须在6~10位以内!\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/view/update.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "25") { echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"用户昵称长度超过10字节!请重试!\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/view/update.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "26") { echo "邮箱格式不正确!请重试!"; exit; } else { if ($final['id'] == "27") { echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"密码不能为空!\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/view/reset.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "28") { echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"两次密码输入不相同!请重试\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/view/reset.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "29") { echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"密码长度必须在6~10位以内!\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/view/reset.php\");\r\n"; echo "</script>"; exit; } else { if ($final['id'] == "30") { echo "<script language=\"JavaScript\">\r\n"; echo "alert(\"修改成功!请重新登录!\");\r\n"; echo "location.replace(\"http://2.osscnu.sinaapp.com/index.php\");\r\n"; echo "</script>"; exit; } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } }
<?php include_once './lib.php'; include_once './config.php'; if (!isPostBack()) { die('Please send subscribe form via POST method...'); } $Email = htmlspecialchars($_POST['txtSubscribe']); $Text = "Subscriber email address recieved : " . $Email; $Subject = "Subscribe"; if (!checkEmailAddress($Email)) { die('Invalid email address...'); } if (!sendmail::send($Email, $subscribeEmail, $Text, $Subject)) { die('Could not send message. failed to connect to mailserver.'); } echo '1';
require_once 'class/sendmail.php'; $array = $_REQUEST; $user_model = new user_model(); if (!empty($array['user_name']) && !empty($array['user_email'])) { if (preg_match($user_model::$regular_expression['username'], $array['user_name']) && preg_match($user_model::$regular_expression['email'], $array['user_email'])) { $user_name = $array['user_name']; $user_email = $array['user_email']; $ktEmail = $user_model->ktEmail($user_name, $user_email); if ($ktEmail == true) { $pass = rand(1, 10000000); $user_pass = md5($pass); $newpass1 = substr($user_pass, 0, 7); $newpass2 = md5($newpass1); $newpass2 = $newpass2[0] . $newpass2; //thực hiện gửi pass mới vào email $sendmail = new sendmail(); $body = 'Đây là mật khẩu của tài khoản ' . $user_name . ' của trang web ' . urlClient . ': ' . $newpass1 . '. Hãy đổi mật khẩu ngay để đảm bảo tính bảo mật của tài khoản. Xin chân thành cảm ơn!'; $result = $sendmail->smtpmailer($user_email, GUSER, 'Administrator', 'FORGOT PASSWORD', $body); if ($result == false) { $response['code'] = 16; $response['status'] = $user_model::$api_response_code[$response['code']]['HTTP Response']; $response['data'] = $error; $user_model->deliver_response($response); } else { //cập nhật lại mật khẩu trong database $user_model->updatePassForGot($user_name, $newpass2); $response['code'] = 0; $response['status'] = $user_model::$api_response_code[$response['code']]['HTTP Response']; $response['data'] = $user_model::$api_response_code[$response['code']]['Message']; $user_model->deliver_response($response);