• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP jsRedirect函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中jsRedirect函数的典型用法代码示例。如果您正苦于以下问题:PHP jsRedirect函数的具体用法?PHP jsRedirect怎么用?PHP jsRedirect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了jsRedirect函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: checkLogin

 public function checkLogin()
 {
     $adminID = Yaf_Session::getInstance()->__get('adminID');
     if (!$adminID) {
         jsRedirect('/admin/login');
     }
 }
开发者ID:xn1224,项目名称:YOF,代码行数:7,代码来源:Admin.php


示例2: registerActAction

 public function registerActAction()
 {
     $m['username'] = $this->getParam('username');
     $m['password'] = $this->getParam('password');
     if (!$m['username'] || !$m['password']) {
         $error = 'Username and password are required !';
         $this->showError($error, 'index');
     }
     // Username exists ?
     $where = array('username' => $m['username']);
     $num = $this->m_user->Where($where)->Total();
     if ($num) {
         $msg = '注册名已存在, 请更换';
         $this->showError($msg, 'index');
     }
     $userID = $this->m_user->Insert($m);
     if (!$userID) {
         $error = '注册失败,请重试';
         $this->showError($error, 'index');
     } else {
         $msg = '注册成功,请登录';
         $url = '/login';
     }
     jsAlert($msg);
     jsRedirect($url);
 }
开发者ID:xn1224,项目名称:YOF,代码行数:26,代码来源:Register.php


示例3: init

 private function init()
 {
     $this->m_user = $this->load('user');
     $userID = $this->getSession('userID');
     if ($userID) {
         jsRedirect('/user/profile');
     }
 }
开发者ID:udeth,项目名称:YOF,代码行数:8,代码来源:Login.php


示例4: resetGetParams

function resetGetParams($params, $newURL = null)
{
    zbx_value2array($params);
    $redirect = false;
    $url = new CUrl($newURL);
    foreach ($params as $num => $param) {
        if (!isset($_GET[$param])) {
            continue;
        }
        $redirect = true;
        $url->setArgument($param, null);
    }
    if ($redirect) {
        jsRedirect($url->getUrl());
        include_once 'include/page_footer.php';
    }
}
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:17,代码来源:func.inc.php


示例5: registerActAction

 public function registerActAction()
 {
     $m['username'] = $this->getPost('username');
     $m['password'] = $this->getPost('password');
     if (!$m['username'] || !$m['password']) {
         $error = 'Username and password are required !';
         $this->showError($error, 'index');
     }
     $userID = $this->m_user->Insert($m);
     if (!$userID) {
         $error = '注册失败,请重试';
         $this->showError($error, 'index');
     } else {
         $msg = '注册成功,请登录';
         $url = '/login';
     }
     jsAlert($msg);
     jsRedirect($url);
 }
开发者ID:udeth,项目名称:YOF,代码行数:19,代码来源:Register.php


示例6: resetActAction

 public function resetActAction()
 {
     $t = $this->getPost('t');
     $m = array();
     $m['password'] = md5($t['newPass']);
     if ($this->adminAccount == $_SESSION['adminName']) {
         $where = array('username' => $_SESSION['adminName']);
         $data = $this->load('Admin')->Where($where)->UpdateOne($m);
     }
     if ($data !== FALSE) {
         unset($_SESSION['admin'], $_SESSION['priv'], $_SESSION['adminID'], $_SESSION['adminName']);
         $msg = '密码修改成功,请重新登录!';
         $url = '/admin/login';
     } else {
         $msg = '密码修改失败!';
         $url = '/admin/index/reset';
     }
     jsAlert($msg);
     jsRedirect($url);
 }
开发者ID:xn1224,项目名称:YOF,代码行数:20,代码来源:Index.php


示例7: actionErrorAction

 public function actionErrorAction()
 {
     $url = 'http://yof.mylinuxer.com/article/abc?pd=1';
     jsRedirect($url);
 }
开发者ID:xinuxZ,项目名称:YOF,代码行数:5,代码来源:Profile.php


示例8: delAction

 public function delAction()
 {
     $articleID = $this->get('articleID');
     $code = $this->m_article->DeleteByID($articleID);
     jsRedirect($this->homeUrl);
 }
开发者ID:GobYang,项目名称:thaidh,代码行数:6,代码来源:Article.php


示例9: access_deny

$trigger = API::Trigger()->get(['triggerids' => $_REQUEST['triggerid'], 'output' => API_OUTPUT_EXTEND, 'expandDescription' => true]);
if (!$trigger) {
    access_deny();
}
$trigger = reset($trigger);
/*
 * Actions
 */
if (hasRequest('update')) {
    DBstart();
    $result = DBexecute('UPDATE triggers' . ' SET comments=' . zbx_dbstr(getRequest('comments')) . ' WHERE triggerid=' . zbx_dbstr(getRequest('triggerid')));
    $trigger['comments'] = $_REQUEST['comments'];
    if ($result) {
        add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_TRIGGER, _('Trigger') . ' [' . $_REQUEST['triggerid'] . '] [' . $trigger['description'] . '] ' . _('Comments') . ' [' . $_REQUEST['comments'] . ']');
    }
    $result = DBend($result);
    show_messages($result, _('Description updated'), _('Cannot update description'));
} elseif (isset($_REQUEST['cancel'])) {
    jsRedirect('tr_status.php');
    exit;
}
/*
 * Display
 */
$triggerEditable = API::Trigger()->get(['triggerids' => $_REQUEST['triggerid'], 'output' => ['triggerid'], 'editable' => true]);
$data = ['triggerid' => getRequest('triggerid'), 'trigger' => $trigger, 'isTriggerEditable' => !empty($triggerEditable), 'isCommentExist' => !empty($trigger['comments'])];
// render view
$triggerCommentView = new CView('monitoring.triggerComment', $data);
$triggerCommentView->render();
$triggerCommentView->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:tr_comments.php


示例10: time

        // add friend if exists & not already is a friend.
        $friendid = $db->getArray('SELECT user_id FROM ' . db_users . ' WHERE username="' . $_POST['name'] . '" LIMIT 1;');
        if (empty($friendid)) {
            $ets->page_body = '<div class="error">' . $l['ucp-fri-badname'] . '</div>';
        } else {
            // are already friends?
            $fid = $friendid['user_id'];
            if ($user->areFriends($fid)) {
                $ets->page_body = '<div class="error">' . $l['ucp-fri-exists'] . '</div>';
            } else {
                // add the friend
                $uid = $user->id;
                $now = time();
                $db->query('INSERT INTO `' . db_friends . "` ( `owner_id` , `friend_id` , `date` )\r\n\t\t\t\tVALUES (\r\n\t\t\t\t'{$uid}', '{$fid}', '{$now}'\r\n\t\t\t\t);");
                // friend is added, send back to list of friends page.
                jsRedirect('usercp.php?action=friends');
            }
        }
    }
    // Show list of friends
    if (count($user->friends) > 0) {
        $ets->page_body .= '<table class="nlb_table"><tr>
		<th>' . $l['username:'] . '</th>
		<th>' . $l['ucp-fri-profile'] . '</th><th>' . $l['ucp-fri-blog'] . '</th>
		<th>' . $l['ucp-fri-added'] . '</th>
		<th>' . $l['ucp-fri-del'] . '</th></tr>';
        // get info on friends.
        $friends = $db->getAllArray('SELECT f.date, u.username, u.blog_count, u.user_id
		FROM ' . db_users . ' as u, ' . db_friends . ' as f
		WHERE f.owner_id = ' . $user->id . ' AND u.user_id = f.friend_id
		ORDER BY f.date DESC;');
开发者ID:nickfun,项目名称:newlifeblogger,代码行数:31,代码来源:friends.php


示例11: checkLoginAction

 public function checkLoginAction()
 {
     $username = $this->getPost('username');
     $password = $this->getPost('password');
     if (!$username || !$password) {
         jsAlert('信息不完整!');
         jsRedirect($this->homeUrl);
     }
     // 管理员登陆
     if (SUPER_ADMIN == $username) {
         $data = $this->m_admin->checkLogin($username, $password);
     } else {
         // 普通角色登陆
         $data = $this->m_role->checkRole($username, $password);
     }
     if (!$data) {
         // Login fail
         $log['status'] = 0;
         jsAlert('账号或密码不正确!');
         jsRedirect($this->homeUrl);
     } else {
         // Login OK, log this action and find privileges
         $this->setSession('adminID', $data['id']);
         $this->setSession('adminName', $username);
         // admin 拥有所有的权限
         if (SUPER_ADMIN == $username) {
             $this->setSession('priv', 'ALL');
         } else {
             // 不是管理员, 记录其 roleID, 用于查找权限
             // 1: 取得登录的角色所拥有的权限
             $priv = $this->m_role->getPrivilegeByRoleID($data['id']);
             // 如果角色没有分配到任何权限, 提示, 并且退出, 有则 SESSION 记录其所有的权限,供进一步处理
             if (!$priv['privilege']) {
                 jsAlert('您还没有任何权限, 请联系管理员!');
                 jsRedirect($this->homeUrl);
             } else {
                 $this->setSession('priv', $priv);
             }
         }
     }
     // Privileges
     include APP_PATH . '/application/modules/Admin/menu.php';
     if (SUPER_ADMIN != $this->getSession('adminName')) {
         $priv = $this->getSession('priv');
         $priv = explode(',', $priv['privilege']);
         // 1: 与大菜单对比, 删除会员没有权限的菜单
         foreach ($menu as $k => $v) {
             foreach ($v as $kk => $vv) {
                 if (is_array($vv)) {
                     foreach ($vv as $kkk => $vvv) {
                         if (!in_array($kkk, $priv)) {
                             unset($menu[$k][$kk][$kkk]);
                         }
                     }
                 }
             }
         }
         // 2: 进一步处理: 删除没有子菜单的项
         foreach ($menu as $k => $v) {
             if (!$v['sub']) {
                 unset($menu[$k]);
             }
         }
     }
     $this->setSession('menu', $menu);
     jsRedirect('/admin/dashboard');
 }
开发者ID:ylh990835774,项目名称:YOF,代码行数:67,代码来源:Login.php


示例12: array

    } else {
        if (isset($_REQUEST['triggers'])) {
            $options = array('output' => API_OUTPUT_SHORTEN, 'acknowledged' => 0, 'triggerids' => $_REQUEST['triggers']);
            $_REQUEST['events'] = CEvent::get($options);
        }
    }
    $eventsData = array('eventids' => zbx_objectValues($_REQUEST['events'], 'eventid'), 'message' => $_REQUEST['message']);
    $result = CEvent::acknowledge($eventsData);
    show_messages($result, S_EVENT_ACKNOWLEDGED, S_CANNOT_ACKNOWLEDGE_EVENT);
    if ($result) {
        $event_acknowledged = true;
        add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_TRIGGER, S_ACKNOWLEDGE_ADDED . ' [' . $bulk ? ' BULK ACKNOWLEDGE ' : expand_trigger_description_by_data($event_trigger) . ']' . ' [' . $_REQUEST['message'] . ']');
    }
    if (isset($_REQUEST['saveandreturn'])) {
        $url = new CUrl(urldecode($_REQUEST['backurl']));
        jsRedirect($url->getUrl());
        exit;
    }
}
$msg = $bulk ? ' BULK ACKNOWLEDGE ' : expand_trigger_description_by_data($event_trigger);
show_table_header(array(S_ALARM_ACKNOWLEDGES_BIG . ': ', $msg));
print SBR;
if ($bulk) {
    $title = S_ACKNOWLEDGE_ALARM_BY;
    $btn_txt2 = S_ACKNOWLEDGE . ' ' . S_AND_SYMB . ' ' . S_RETURN;
} else {
    $db_acks = get_acknowledges_by_eventid($_REQUEST['eventid']);
    if ($db_acks) {
        $table = new CTable(null, 'ack_msgs');
        $table->setAlign('center');
        while ($db_ack = DBfetch($db_acks)) {
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:acknow.php


示例13: text

 *		E D I T   N E W S   I T E M
 * =======================================
 */
if (!defined('IN_NLB3')) {
    echo 'NLB3 Denies Direct Access';
    exit;
}
$text = new text($_POST, array('body'), array('subject', 'bb', 'html', 'smiles', 'comments'));
$problems = array();
$baddata = false;
$USESKIN = skin_basic;
$ets_outter->main_title = $config->get('site_name') . ": " . $l['acp-editnews'];
$ets_outter->page_title = $l['acp-editnews'];
if (!isset($_GET['id'])) {
    // No news ID specified.
    jsRedirect("admincp.php?action=edit_list");
}
if (!empty($_POST)) {
    /**
     *		Check submited data
     */
    $text->validate();
    $text->makeClean('trim', 'slash_if_needed');
    $c = $text->clean;
    if ($text->is_missing_required) {
        $baddata = true;
    } else {
        /**
         * 		U P D A T E   I T E M
         */
        // deal with options.
开发者ID:nickfun,项目名称:newlifeblogger,代码行数:31,代码来源:edit_news.php


示例14: jsRedirect

<?php

/**
 * =======================================
 * 		E D I T   A R T I C L E
 * =======================================
 */
if (!defined('IN_NLB3')) {
    echo 'NLB3 Denies Direct Access';
    exit;
}
if (!isset($_GET['id'])) {
    jsRedirect('admincp.php?action=list_article');
}
$USESKIN = skin_basic;
$text = new text($_POST, array('subject', 'body'));
$text->validate();
$text->makeClean('slash_if_needed', 'trim');
$baddata = false;
$problems = array();
$ets->page_body = '';
$ets_outter->main_title = $config->get('site_name') . ": " . $l['title-art-edit'];
$ets_outter->page_title = $l['title-art-edit'];
if (!empty($_POST)) {
    // check data
    if ($text->is_missing_required) {
        $baddata = true;
    } else {
        $subject = $text->clean['subject'];
        $body = $text->clean['body'];
        badHtmlSecond($body);
开发者ID:nickfun,项目名称:newlifeblogger,代码行数:31,代码来源:edit_article.php


示例15: jsRedirect

<?php

/**
 * =======================================
 *		E D I T   U S E R
 * =======================================
 */
if (!defined('IN_NLB3')) {
    echo 'NLB3 Denies Direct Access';
    exit;
}
$ets->page_body = '';
$baddata = false;
if (!isset($_GET['id'])) {
    jsRedirect('admincp.php?action=edit_user');
} else {
    $USERID = $_GET['id'];
    $edituser = new nlb_user($db, $USERID);
}
$text = new text($_POST, array('username', 'email', 'blog_count', 'timezone', 'access'), array('bio', 'custom'));
$text->validate();
$text->makeClean('trim', 'slash_if_needed');
if (!empty($_POST)) {
    // check data
    if ($text->is_missing_required) {
        $baddata = true;
    } else {
        $c = $text->clean;
        $c['timezone'] -= 13;
        foreach ($c as $key => $value) {
            $edituser->set($key, $value);
开发者ID:nickfun,项目名称:newlifeblogger,代码行数:31,代码来源:edit_user_id.php


示例16: checkBanned

 /**
  * @return void
  * @desc looks for banned users, and sends them to propper page.
  * @date 02-24-04
  */
 function checkBanned()
 {
     // get rid of old bans
     $this->sql->query('DELETE FROM ' . db_banned . ' WHERE expires < ' . time() . ';');
     $ip = $_SERVER['REMOTE_ADDR'];
     $row = $this->sql->getArray('SELECT banned_id FROM ' . db_banned . ' WHERE ip="' . $ip . '" OR user_id="' . $this->id . '" LIMIT 1;');
     if (empty($row)) {
         // not banned!
         return $this->isLogedIn;
     } else {
         // BANNED USER!
         jsRedirect(script_path . 'banned.php?id=' . $row['banned_id']);
     }
 }
开发者ID:nickfun,项目名称:newlifeblogger,代码行数:19,代码来源:nlb_user.class.php


示例17: assignActAction

 /**
  * Assign or update privilege action
  */
 public function assignActAction()
 {
     // 1: 取得选择的权限
     $finalArr = array();
     foreach ($_POST as $key => $val) {
         if (is_array($val)) {
             foreach ($val as $k => $v) {
                 $finalArr[] = $v;
             }
         }
     }
     $roleID = $this->getPost('roleID');
     $privilege = implode(',', $finalArr);
     $data = $this->m_role->updatePrivilegeByRoleID($roleID, $privilege);
     if ($data === FALSE) {
         jsAlert('更新权限失败');
     }
     jsRedirect($this->homeUrl);
 }
开发者ID:GobYang,项目名称:thaidh,代码行数:22,代码来源:Role.php


示例18: sqldb2

require_once 'system/ets_file.php';
require_once 'system/sqldb2.class.php';
require_once 'system/nlb_user.class.php';
require_once 'system/nlb_config.class.php';
require_once 'system/nlb_blog.class.php';
require_once 'system/nlb_mail.class.php';
require_once 'system/text.class.php';
require_once 'ets.php';
$db = new sqldb2($DB_CONFIG);
$user = new nlb_user($db);
$config = new nlb_config($db);
$blog = new nlb_blog($db);
$user->checkLogin();
// check for loged in user.
if ($user->isLogedIn) {
    jsRedirect("index.php");
}
include $config->langfile();
$start = mymicrotime();
$text = new Text($_POST, array('username', 'password', 'confirm-password', 'email', 'template', 'timezone'), array('custom'));
$text->validate();
$clean = $text->clean;
$baddata = false;
$problems = array();
if (!empty($_POST)) {
    if ($text->is_missing_required) {
        $baddata = true;
    }
    // if there was good submitted data...
    if ($clean['password'] != $clean['confirm-password']) {
        $baddata = true;
开发者ID:nickfun,项目名称:newlifeblogger,代码行数:31,代码来源:register.php


示例19: text

<?php

/**
 * =======================================
 * 		E D I T   S M I L E
 * =======================================
 */
if (!defined('IN_NLB3')) {
    echo 'NLB3 Denies Direct Access';
    exit;
}
$text = new text($_POST, array('smile_id', 'image', 'code', 'desc'), array("delete"));
$text->validate();
if ($text->is_missing_required) {
    jsRedirect("admincp.php?action=smiles");
    die;
}
$text->makeClean("slash_if_needed");
$c = $text->clean;
// delete or update?
if (empty($c['delete'])) {
    $db->query("UPDATE `" . db_smiles . "`\r\n\tSET `code` = '" . $c['code'] . "', \r\n\t`image` = '" . $c['image'] . "', \r\n\t`desc` = '" . $c['desc'] . "' \r\n\tWHERE `smile_id` = " . $c['smile_id'] . "\r\n\tLIMIT 1;");
} else {
    $db->query("DELETE FROM " . db_smiles . "\r\n\tWHERE `smile_id` = " . $c['smile_id'] . "\r\n\tLIMIT 1;");
}
// done here, back to manager...
jsRedirect("admincp.php?action=smiles");
开发者ID:nickfun,项目名称:newlifeblogger,代码行数:27,代码来源:edit_smile.php


示例20: logoutAction

 public function logoutAction()
 {
     $this->unsetSession('adminID');
     $this->unsetSession('adminName');
     jsRedirect($this->homeUrl);
 }
开发者ID:udeth,项目名称:YOF,代码行数:6,代码来源:Login.php



注:本文中的jsRedirect函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP jsSafe函数代码示例发布时间:2022-05-15
下一篇:
PHP js函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap