本文整理汇总了PHP中emDirect函数的典型用法代码示例。如果您正苦于以下问题:PHP emDirect函数的具体用法?PHP emDirect怎么用?PHP emDirect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了emDirect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
if ($action == 'reg') {
$user = isset($_POST['user']) ? addslashes(trim($_POST['user'])) : '';
$email = isset($_POST['email']) ? addslashes(trim($_POST['email'])) : '';
$pw = isset($_POST['pw']) ? addslashes(trim($_POST['pw'])) : '';
$repw = isset($_POST['repw']) ? addslashes(trim($_POST['repw'])) : '';
$chcode = isset($_POST['chcode']) ? addslashes(trim(strtoupper($_POST['chcode']))) : '';
$User_Model = new User_Model();
$error_msg = '';
if ($user == '') {
emDirect('./reg.php?error_login=1');
}
if ($User_Model->isUserExist($user)) {
emDirect('./reg.php?error_exist=1');
}
if (strlen($pw) < 6) {
emDirect('./reg.php?error_pwd_len=1');
}
if ($pw != $repw) {
emDirect('./reg.php?error_pwd2=1');
}
session_start();
$sessionCode = isset($_SESSION['code']) ? $_SESSION['code'] : '';
if (empty($chcode) || $chcode != $sessionCode) {
emDirect('./reg.php?error_chcode=1');
}
$PHPASS = new PasswordHash(8, true);
$pw = $PHPASS->HashPassword($pw);
$User_Model->addUser($user, $pw, ROLE_MEMBER, 'y');
$CACHE->updateCache(array('sta', 'user'));
emDirect('./?reg_ok=1');
}
示例2: addComment
function addComment($name, $content, $mail, $url, $imgcode, $blogId, $pid)
{
$ipaddr = getIp();
$utctimestamp = time();
if ($pid != 0) {
$comment = $this->getOneComment($pid);
$content = '@' . addslashes($comment['poster']) . ':' . $content;
}
$ischkcomment = Option::get('ischkcomment');
$hide = ROLE == ROLE_VISITOR ? $ischkcomment : 'n';
$sql = 'INSERT INTO ' . DB_PREFIX . "comment (date,poster,gid,comment,mail,url,hide,ip,pid)\n VALUES ('{$utctimestamp}','{$name}','{$blogId}','{$content}','{$mail}','{$url}','{$hide}','{$ipaddr}','{$pid}')";
$ret = $this->db->query($sql);
$cid = $this->db->insert_id();
$CACHE = Cache::getInstance();
if ($hide == 'n') {
$this->db->query('UPDATE ' . DB_PREFIX . "blog SET comnum = comnum + 1 WHERE gid='{$blogId}'");
$CACHE->updateCache(array('sta', 'comment'));
doAction('comment_saved', $cid);
emDirect(Url::log($blogId) . '#' . $cid);
} else {
$CACHE->updateCache('sta');
doAction('comment_saved', $cid);
emMsg('评论发表成功,请等待管理员审核', Url::log($blogId));
}
}
示例3: isset
}
//上传zip模板
if ($action == 'upload_zip') {
LoginAuth::checkToken();
$zipfile = isset($_FILES['tplzip']) ? $_FILES['tplzip'] : '';
if ($zipfile['error'] == 4) {
emDirect("./template.php?action=install&error_d=1");
}
if (!$zipfile || $zipfile['error'] >= 1 || empty($zipfile['tmp_name'])) {
emMsg('模板上传失败');
}
if (getFileSuffix($zipfile['name']) != 'zip') {
emDirect("./template.php?action=install&error_a=1");
}
$ret = emUnZip($zipfile['tmp_name'], '../content/templates/', 'tpl');
switch ($ret) {
case 0:
emDirect("./template.php?activate_install=1#tpllib");
break;
case -2:
emDirect("./template.php?action=install&error_e=1");
break;
case 1:
case 2:
emDirect("./template.php?action=install&error_b=1");
break;
case 3:
emDirect("./template.php?action=install&error_c=1");
break;
}
}
示例4: isset
$pid = isset($_POST['pid']) ? intval(trim($_POST['pid'])) : 0;
$navi_data = array('naviname' => $naviname, 'newtab' => $newtab, 'pid' => $pid);
if (empty($naviname)) {
unset($navi_data['naviname']);
}
if ($isdefault == 'n') {
$navi_data['url'] = $url;
}
$Navi_Model->updateNavi($navi_data, $naviId);
$CACHE->updateCache('navi');
emDirect("./navbar.php?active_edit=1");
}
if ($action == 'del') {
LoginAuth::checkToken();
$navid = isset($_GET['id']) ? intval($_GET['id']) : '';
$Navi_Model->deleteNavi($navid);
$CACHE->updateCache('navi');
emDirect("./navbar.php?active_del=1");
}
if ($action == 'hide') {
$naviId = isset($_GET['id']) ? intval($_GET['id']) : '';
$Navi_Model->updateNavi(array('hide' => 'y'), $naviId);
$CACHE->updateCache('navi');
emDirect('./navbar.php');
}
if ($action == 'show') {
$naviId = isset($_GET['id']) ? intval($_GET['id']) : '';
$Navi_Model->updateNavi(array('hide' => 'n'), $naviId);
$CACHE->updateCache('navi');
emDirect('./navbar.php');
}
示例5: implode
if (file_exists($style_path . $file . '/style.css')) {
$styleData = implode('', @file($style_path . $file . '/style.css'));
preg_match("/Style Name:([^\r\n]+)/i", $styleData, $name);
preg_match("/Author:(.*)/i", $styleData, $author);
preg_match("/Url:(.*)/i", $styleData, $url);
$styleInfo['style_name'] = !empty($name[1]) ? trim($name[1]) : $file;
$styleInfo['style_file'] = $file;
if (!empty($author[1]) && !empty($url[1])) {
$styleInfo['style_author'] = '(作者:<a href="' . $url[1] . '" target="_blank">' . $author[1] . '</a>)';
} elseif (!empty($author[1])) {
$styleInfo['style_author'] = '(作者:' . $author[1] . ')';
} else {
$styleInfo['style_author'] = '';
}
$styles[] = $styleInfo;
}
}
closedir($handle);
$stylenums = count($styles);
include View::getView('header');
require_once View::getView('style');
include View::getView('footer');
View::output();
}
//update
if ($action == 'usestyle') {
$styleName = isset($_GET['style']) ? addslashes($_GET['style']) : '';
Option::updateOption('admin_style', $styleName);
$CACHE->updateCache('options');
emDirect("./style.php?activated=1");
}
示例6: SignOut
/**
* 手动退出登录
* @param string
* @return null
*/
public function SignOut($UserInfo = null)
{
if ($UserInfo) {
Juser::setAuthOut();
}
emDirect(BLOG_URL);
}
示例7: isset
$avatar = isset($_POST['avatar']) ? addslashes(trim($_POST['avatar'])) : '';
$type = array('gif', 'jpg', 'jpeg', 'png');
if ($_FILES['avatar']['size'] > 0) {
$file_info = uploadFile($_FILES['avatar']['name'], $_FILES['avatar']['error'], $_FILES['avatar']['tmp_name'], $_FILES['avatar']['size'], $type, true);
if (!empty($file_info['file_path'])) {
$avatar = !empty($file_info['thum_file']) ? $file_info['thum_file'] : $file_info['file_path'];
}
}
$userData = array('name' => $name, 'vipid' => '', 'age' => $age, 'sex' => $sex, 'dance_age' => $dance_age, 'dance_type' => $dance_type, 'province' => $province, 'contact' => $contact, 'company' => $company, 'awards' => $awards, 'homeurl' => $homeurl, 'avatar' => $avatar, 'duty' => '10', 'regist' => 1);
$Vip_model->addUser($userData);
$mail = new PHPMailer();
$mail->isSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 0;
$mail->Debugoutput = 'html';
$mail->CharSet = "UTF-8";
$mail->Host = SMTP_HOST;
$mail->Port = SMTP_POST;
$mail->SMTPAuth = true;
$mail->Username = SMTP_USER_NAME;
$mail->Password = SMTP_PASSWORD;
$mail->setFrom(SMTP_USER_NAME);
$mail->addAddress(EMAIL_VIP_VIPORG);
$mail->Subject = '新会员申请提醒 姓名:' . $name;
$mail->Body = '请去后台管理页面查看并审核';
$mail->send();
emDirect('./payment.php?active_add=1');
}
示例8: emDirect
}
if (strlen($reply) > 2000) {
emDirect("./comment.php?error_d=1");
}
if (isset($_POST['pub_it'])) {
$Comment_Model->showComment($commentId);
$hide = 'n';
}
$Comment_Model->replyComment($blogId, $commentId, $reply, $hide);
$CACHE->updateCache('comment');
$CACHE->updateCache('sta');
doAction('comment_reply', $commentId, $reply);
emDirect("./comment.php?active_rep=1");
}
if ($action == 'doedit') {
$name = isset($_POST['name']) ? addslashes(trim($_POST['name'])) : '';
$mail = isset($_POST['mail']) ? addslashes(trim($_POST['mail'])) : '';
$url = isset($_POST['url']) ? addslashes(trim($_POST['url'])) : '';
$comment = isset($_POST['comment']) ? addslashes(trim($_POST['comment'])) : '';
$commentId = isset($_POST['cid']) ? intval($_POST['cid']) : '';
if ($comment == '') {
emDirect("./comment.php?error_e=1");
}
if (strlen($comment) > 2000) {
emDirect("./comment.php?error_d=1");
}
$commentData = array('poster' => $name, 'mail' => $mail, 'url' => $url, 'comment' => $comment);
$Comment_Model->updateComment($commentData, $commentId);
$CACHE->updateCache('comment');
emDirect("./comment.php?active_edit=1");
}
示例9: isset
$tagId = isset($_GET['tid']) ? intval($_GET['tid']) : '';
$tag = $Tag_Model->getOneTag($tagId);
extract($tag);
include View::getView('header');
require_once View::getView('tagedit');
include View::getView('footer');
View::output();
}
//标签修改
if ($action == 'update_tag') {
$tagName = isset($_POST['tagname']) ? addslashes($_POST['tagname']) : '';
$tagId = isset($_POST['tid']) ? intval($_POST['tid']) : '';
if (empty($tagName)) {
emDirect("tag.php?action=mod_tag&tid={$tagId}&error_a=1");
}
$Tag_Model->updateTagName($tagId, $tagName);
$CACHE->updateCache(array('tags', 'logtags'));
emDirect("./tag.php?active_edit=1");
}
//批量删除标签
if ($action == 'dell_all_tag') {
$tags = isset($_POST['tag']) ? $_POST['tag'] : '';
if (!$tags) {
emDirect("./tag.php?error_a=1");
}
foreach ($tags as $key => $value) {
$Tag_Model->deleteTag($key);
}
$CACHE->updateCache(array('tags', 'logtags'));
emDirect("./tag.php?active_del=1");
}
示例10: emDirect
if (!$t) {
emDirect("twitter.php?error_a=1");
}
$tdata = array('content' => $Twitter_Model->formatTwitter($t), 'author' => UID, 'date' => time(), 'img' => str_replace('../', '', $img));
$twid = $Twitter_Model->addTwitter($tdata);
$CACHE->updateCache(array('sta', 'newtw'));
doAction('post_twitter', $t, $twid);
emDirect("twitter.php?active_t=1");
}
// 删除微语.
if ($action == 'del') {
LoginAuth::checkToken();
$id = isset($_GET['id']) ? intval($_GET['id']) : '';
$Twitter_Model->delTwitter($id);
$CACHE->updateCache(array('sta', 'newtw'));
emDirect("twitter.php?active_del=1");
}
// 获取回复.
if ($action == 'getreply') {
$tid = isset($_GET['tid']) ? intval($_GET['tid']) : null;
$Reply_Model = new Reply_Model();
$replys = $Reply_Model->getReplys($tid);
$response = '';
foreach ($replys as $val) {
if ($val['hide'] == 'n') {
$style = "background-color:#FFF";
$act = "<span><a href=\"javascript: hidereply({$val['id']},{$tid});\">隐藏</a></span> ";
} else {
$style = "background-color:#FEE0E4";
$act = "<span><a href=\"javascript: pubreply({$val['id']},{$tid});\">审核</a></span> ";
}
示例11: isset
}
//上传zip插件
if ($action == 'upload_zip') {
LoginAuth::checkToken();
$zipfile = isset($_FILES['pluzip']) ? $_FILES['pluzip'] : '';
if ($zipfile['error'] == 4) {
emDirect("./plugin.php?error_d=1");
}
if (!$zipfile || $zipfile['error'] >= 1 || empty($zipfile['tmp_name'])) {
emMsg('插件上传失败');
}
if (getFileSuffix($zipfile['name']) != 'zip') {
emDirect("./plugin.php?error_f=1");
}
$ret = emUnZip($zipfile['tmp_name'], '../content/plugins/', 'plugin');
switch ($ret) {
case 0:
emDirect("./plugin.php?activate_install=1#tpllib");
break;
case -1:
emDirect("./plugin.php?error_e=1");
break;
case 1:
case 2:
emDirect("./plugin.php?error_b=1");
break;
case 3:
emDirect("./plugin.php?error_c=1");
break;
}
}
示例12: isset
<div class="clear"></div>
</div>
<!-- End .content-box-header -->
<div class="content-box-content">
<div class="tab-content default-tab" id="tab1" style="display: block; ">
<!-- This is the target div. id must match the href of this div's tab -->
<?php
require_once 'define.php';
require_once 'mysql.php';
require_once 'FunctionBase.php';
$mysql = MySql::getInstance();
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
if ($action == 'del' && isset($_REQUEST['id'])) {
$id = $_REQUEST['id'];
$mysql->query("delete from ErrFeature where id='" . $id . "';");
emDirect("FeatureList.php?active_del=true");
}
$rq = $mysql->query('select * from ErrFeature');
?>
<table>
<thead>
<tr>
<th>ID</th>
<th>类型</th>
<th>特征表达式</th>
<th>提示信息</th>
<th>操作</th>
</tr>
</thead>
<tfoot>
<tr>
示例13: header
header("content-Type: text/html; charset=utf-8");
require_once 'FunctionBase.php';
require_once 'mysql.php';
/*
print_r($_REQUEST['feature']);
echo '<br />';
print_r($_REQUEST['info']);
echo '<br />';
*/
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
$regex = $_REQUEST['regex'];
$info = $_REQUEST['info'];
$type = $_REQUEST['type'];
if ($action == 'new') {
$mysql = MySql::getInstance();
$regex = mysql_real_escape_string($regex);
$info = mysql_real_escape_string($info);
$sql = "insert into ErrFeature(regex, info, type) values('" . $regex . "','" . $info . "','" . $type . "');\n";
$rq = $mysql->query($sql);
} else {
if ($action == 'update') {
$id = intval($_REQUEST['id']);
$mysql = MySql::getInstance();
$regex = mysql_real_escape_string($regex);
$info = mysql_real_escape_string($info);
$sql = "update ErrFeature set regex='" . $regex . "', info='" . $info . "', type='" . $type . "' where id=" . $id . ";";
$rq = $mysql->query($sql);
}
}
emDirect('FeatureList.php');
示例14: isset
if ($action == 'update') {
$uid = isset($_POST['uid']) ? intval(trim($_POST['uid'])) : '';
$vipid = isset($_POST['vipid']) ? addslashes(trim($_POST['vipid'])) : '';
$name = isset($_POST['name']) ? addslashes(trim($_POST['name'])) : '';
$age = isset($_POST['age']) ? addslashes(trim($_POST['age'])) : '';
$sex = isset($_POST['sex']) ? addslashes(trim($_POST['sex'])) : '';
$province = isset($_POST['province']) ? addslashes(trim($_POST['province'])) : '';
$dance_age = isset($_POST['dance_age']) ? addslashes(trim($_POST['dance_age'])) : '';
$contact = isset($_POST['contact']) ? addslashes(trim($_POST['contact'])) : '';
$dance_type = isset($_POST['dance_type']) ? addslashes(trim($_POST['dance_type'])) : '';
$company = isset($_POST['company']) ? addslashes(trim($_POST['company'])) : '';
$awards = isset($_POST['awards']) ? addslashes(trim($_POST['awards'])) : '';
$homeurl = isset($_POST['homeurl']) ? addslashes(trim($_POST['homeurl'])) : '';
$duty = isset($_POST['duty']) ? addslashes(trim($_POST['duty'])) : '';
$avatar = isset($_POST['avatar']) ? addslashes(trim($_POST['avatar'])) : '';
$type = array('gif', 'jpg', 'jpeg', 'png');
if ($_FILES['avatar']['size'] > 0) {
$file_info = uploadFile($_FILES['avatar']['name'], $_FILES['avatar']['error'], $_FILES['avatar']['tmp_name'], $_FILES['avatar']['size'], $type, true);
if (!empty($file_info['file_path'])) {
$avatar = !empty($file_info['thum_file']) ? $file_info['thum_file'] : $file_info['file_path'];
}
}
$userData = array('name' => $name, 'vipid' => $vipid, 'age' => $age, 'sex' => $sex, 'dance_age' => $dance_age, 'dance_type' => $dance_type, 'province' => $province, 'contact' => $contact, 'company' => $company, 'awards' => $awards, 'homeurl' => $homeurl, 'avatar' => $avatar, 'duty' => $duty, 'regist' => 0);
$Vip_model->updateUser($userData, $uid);
emDirect('./vip.php?active_update=1');
}
if ($action == 'del') {
$id = isset($_GET['id']) ? intval($_GET['id']) : '';
$Vip_model->deleteUser($id);
emDirect('./vip.php?active_del=1');
}
示例15: define
define('OFFICIAL_SERVICE_HOST', 'http://www.emlog.net/');
//官方服务域名
$sta_cache = $CACHE->readCache('sta');
$user_cache = $CACHE->readCache('user');
$action = isset($_GET['action']) ? addslashes($_GET['action']) : '';
//登录验证
if ($action == 'login') {
$username = isset($_POST['user']) ? addslashes(trim($_POST['user'])) : '';
$password = isset($_POST['pw']) ? addslashes(trim($_POST['pw'])) : '';
$ispersis = isset($_POST['ispersis']) ? intval($_POST['ispersis']) : false;
$img_code = Option::get('login_code') == 'y' && isset($_POST['imgcode']) ? addslashes(trim(strtoupper($_POST['imgcode']))) : '';
$loginAuthRet = LoginAuth::checkUser($username, $password, $img_code);
if ($loginAuthRet === true) {
LoginAuth::setAuthCookie($username, $ispersis);
emDirect("./");
} else {
LoginAuth::loginPage($loginAuthRet);
}
}
//退出
if ($action == 'logout') {
setcookie(AUTH_COOKIE_NAME, ' ', time() - 31536000, '/');
emDirect("../");
}
if (ISLOGIN === false) {
LoginAuth::loginPage();
}
$request_uri = strtolower(substr(basename($_SERVER['SCRIPT_NAME']), 0, -4));
if (ROLE == ROLE_WRITER && !in_array($request_uri, array('write_log', 'admin_log', 'attachment', 'blogger', 'comment', 'index', 'save_log'))) {
emMsg('权限不足!', './');
}