本文整理汇总了PHP中headers类的典型用法代码示例。如果您正苦于以下问题:PHP headers类的具体用法?PHP headers怎么用?PHP headers使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了headers类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
function save()
{
$array = file(ROOT . '/config.php');
$content = '';
foreach ($array as $k => $v) {
if (strstr($v, '#system_style')) {
$array[$k] = "define('SYS_STYLE', '" . params::get('system_style') . "'); #system_style\r\n";
}
if (strstr($v, '#system_lang')) {
$array[$k] = "define('LANG_INDEX', '" . params::get('system_lang') . "'); #system_lang\r\n";
}
if (strstr($v, '#global_cache')) {
if (params::get('global_cache')) {
$array[$k] = "define('GLOBAL_CACHE', true); #global_cache\r\n";
} else {
$array[$k] = "define('GLOBAL_CACHE', false); #global_cache\r\n";
}
}
if (strstr($v, '#global_time')) {
$array[$k] = "define('GLOBAL_CACHE_TIME', " . params::get('global_cache_time') . "); #global_time\r\n";
}
$content .= $array[$k];
}
files::write(ROOT . '/config.php', $content);
headers::self();
}
示例2: save
function save()
{
settings::set('feedback', 'feedback_email', params::get('feedback_email'));
settings::set('feedback', 'feedback_subject', params::get('feedback_subject'));
settings::save('feedback');
headers::self();
}
示例3: saveMail
function saveMail()
{
db::table('mails');
db::where('mail_id', admin::get('id'));
db::update(array('mail_name' => params::get('mail_name'), 'mail_subject' => params::get('mail_subject'), 'mail_content' => params::get('mail_content')));
headers::self();
}
示例4: _add
function _add()
{
$array = array('news_date' => 'NOW()', 'news_pub' => '1', 'news_title' => params::get('news_title'), 'news_content' => params::get('news_content'), 'news_desc' => params::get('news_desc'));
db::table('news');
db::smartInsert($array);
headers::app('news');
}
示例5: __construct
public function __construct($html = false)
{
headers::not_found();
# send 404
if ($html === true) {
$this->html();
}
}
示例6: replace
function replace()
{
$page_id = params::get('page_id');
db::table('pages');
db::limit(1);
db::where('page_id', $page_id);
$page_folder = db::get('page_folder');
headers::url($page_folder);
//self::loadPage();
}
示例7: sendFeedback
function sendFeedback()
{
$mail_content = params::get('message');
$email = params::get('email');
if (!empty($mail_content) && !empty($email)) {
mail::from($email);
mail::html($mail_content);
mail::subject(settings::get('feedback', 'feedback_subject'));
mail::send(settings::get('feedback', 'feedback_email'));
headers::url('/contacts/success/');
}
}
示例8: save
function save()
{
settings::set('pages', 'global_page_keywords', params::get('global_page_keywords'));
settings::set('pages', 'global_page_description', params::get('global_page_description'));
settings::set('pages', 'global_page_keywords_check', params::isCheck('global_page_keywords_check'));
settings::set('pages', 'global_page_description_check', params::isCheck('global_page_description_check'));
settings::set('pages', 'redactor', params::isCheck('redactor'));
settings::set('pages', 'jip', params::isCheck('jip'));
settings::set('pages', 'global_page_title', params::get('global_page_title'));
settings::save('pages');
headers::self();
}
示例9: actionIndex
/**
* Prepares a list of products and renders accordingly
*
* If the request comes from an AJAX request containing pagination data, the resultant table will be
* paginated appropriately. Otherwise, a default pagination state (no sorting, no filtering, page 1)
* will be created.
*/
public function actionIndex()
{
$statuses = statuses::model()->getAll();
$vendors = vendors::model()->getAll();
$tags = tags::model()->getAll();
$showColumns = Auth::User()->getColumns();
if (count($showColumns) == 0) {
$showColumns = array(1, 2, 3);
}
$columnHeaders = headers::model()->getAll();
$allHeaders = array();
foreach ($columnHeaders as $header) {
$allHeaders[$header->id] = $header;
}
$headers = array('show' => $showColumns, 'headers' => $allHeaders);
$pagination = array('limit' => array(0, 10), 'filter' => 'All categories', 'sortAttribute' => null, 'sortDirection' => null);
if (!empty($_GET['ajax'])) {
//handle ajax requests
//get the pagination data from the query string
if (isset($_GET['headers'])) {
$headers['show'] = explode(',', $_GET['headers']);
Auth::User()->setColumns($_GET['headers']);
}
$sortHeader = headers::model()->getbyPK($_GET['sortAttribute']);
$pagination['sortAttribute'] = $sortHeader->sortName;
$pagination['sortDirection'] = $_GET['sortDirection'];
$pagination['limit'] = array($_GET['paginationPageNumber'], $_GET['paginationPerPage']);
$pagination['filter'] = $_GET['filter'];
$conditions = null;
$params = null;
//if there is a filter in place, create the conditions and parameters needed
if (!empty($pagination['filter']) && $pagination['filter'] != 'All categories') {
$conditions = "category = :category";
$category = categories::model()->getByAttribute('name', $pagination['filter']);
$params = array('category' => $category->id);
}
$models = items::model(true)->getAll($conditions, $params, $pagination);
$count = items::model()->getCount($conditions, $params);
$pagination['count'] = $count;
$pagination['sortAttribute'] = $_GET['sortAttribute'];
$this->renderPartial('table', array('data' => $models, 'statuses' => $statuses, 'pagination' => $pagination, 'vendors' => $vendors, 'tags' => $tags, 'headers' => $headers));
} else {
//handle default requests
$models = items::model(true)->getAll(null, null, $pagination);
$count = items::model()->getCount(null);
$pagination['count'] = $count;
$this->render('index', array('models' => $models, 'statuses' => $statuses, 'vendors' => $vendors, 'tags' => $tags, 'pagination' => $pagination, 'headers' => $headers));
}
}
示例10: send
/** send headers **/
function send()
{
global $sendheaders, $sendnocacheheaders, $gzip;
if ($sendheaders == 1) {
@header("HTTP/1.0 200 OK");
@header("HTTP/1.1 200 OK");
@header("Content-type: text/html");
}
if ($sendnocacheheaders == 1) {
@header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
@header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
@header("Cache-Control: no-cache, must-revalidate");
@header("Pragma: no-cache");
}
if ($gzip == 1) {
headers::compress();
}
}
示例11: upload
function upload()
{
$dir = IMAGES_ROOT . 'index/';
@mkdir(IMAGES_ROOT);
@mkdir($dir);
if (!empty($_FILES['file']['name'])) {
$img_id = md5(date('YmdHis'));
$file = $dir . $img_id . '.jpg';
$file_m = $dir . $img_id . '_m.jpg';
copy($_FILES['file']['tmp_name'], $file);
images::src($file);
images::thumb($file_m);
images::setWidth(150);
images::resize();
$array = array('img_id' => $img_id, 'img_set' => '0');
db::table('images');
db::smartInsert($array);
}
headers::self();
}
示例12: start
function start($engine = true)
{
self::$site = str_replace('www.', '', $_SERVER['HTTP_HOST']);
self::$query_string = urldecode($_SERVER['QUERY_STRING']);
self::$request_uri = str_replace('?' . self::$query_string, '', urldecode($_SERVER['REQUEST_URI']));
if (!self::$request_uri) {
self::$request_uri = '/';
}
/*
Sections
*/
self::$sections = explode('/', string::clearBoth(self::$request_uri));
if (!self::$sections) {
self::$sections[0] = '';
}
self::loadEngine();
// load sites.ini
if (self::$engine == 'web') {
// redirects
$redirect = false;
$ini = ini::parse(SYS_ROOT . 'conf/global/sites.ini', 'redirects');
if ($ini) {
$redirect = arrays::returnValue($ini, self::$site);
if ($redirect) {
headers::site($redirect);
}
}
// mirrors
$ini = ini::get('mirrors');
if ($ini) {
$mirror = arrays::returnValue($ini, self::$site);
if ($mirror) {
self::$site = $mirror;
}
}
}
self::setConst();
if ($engine) {
load::engine(ENGINE);
}
}
示例13: headers
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
OCOMON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Foobar; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
include "../../includes/include_geral.inc.php";
include "../../includes/include_geral_II.inc.php";
$cab = new headers();
$cab->set_title(HTML_TITLE);
$auth = new auth();
$auth->testa_user($s_usuario, $s_nivel, $s_nivel_desc, 4);
$hoje = date("Y-m-d H:i:s");
$cor = TD_COLOR;
$cor1 = TD_COLOR;
$cor3 = BODY_COLOR;
$queryA = "SELECT\n\n\t\t\tmold.mold_marca as padrao,\n\t\t\tmold.mold_inv as etiqueta, mold.mold_sn as serial, mold.mold_nome as nome,\n \t\t\tmold.mold_nf as nota,\n\n \t\t\tmold.mold_coment as comentario, mold.mold_valor as valor, mold.mold_data_compra as\n\t\t\tdata_compra, mold.mold_ccusto as ccusto,\n\n\t\t\tinst.inst_nome as instituicao, inst.inst_cod as cod_inst,\n\n\t\t\tequip.tipo_nome as equipamento, equip.tipo_cod as equipamento_cod,\n\n\t\t\tt.tipo_imp_nome as impressora, t.tipo_imp_cod as impressora_cod,\n\n\t\t\tloc.local as local, loc.loc_id as local_cod,\n\n\n\n\t\t\tproc.mdit_fabricante as fabricante_proc, proc.mdit_desc as processador, proc.mdit_desc_capacidade as clock, proc.mdit_cod as cod_processador,\n\t\t\thd.mdit_fabricante as fabricante_hd, hd.mdit_desc as hd, hd.mdit_desc_capacidade as hd_capacidade,hd.mdit_cod as cod_hd,\n\t\t\tvid.mdit_fabricante as fabricante_video, vid.mdit_desc as video, vid.mdit_cod as cod_video,\n\t\t\tred.mdit_fabricante as rede_fabricante, red.mdit_desc as rede, red.mdit_cod as cod_rede,\n\t\t\tmodm.mdit_fabricante as fabricante_modem, modm.mdit_desc as modem, modm.mdit_cod as cod_modem,\n\t\t\tcd.mdit_fabricante as fabricante_cdrom, cd.mdit_desc as cdrom, cd.mdit_cod as cod_cdrom,\n\t\t\tgrav.mdit_fabricante as fabricante_gravador, grav.mdit_desc as gravador, grav.mdit_cod as cod_gravador,\n\t\t\tdvd.mdit_fabricante as fabricante_dvd, dvd.mdit_desc as dvd, dvd.mdit_cod as cod_dvd,\n\t\t\tmb.mdit_fabricante as fabricante_mb, mb.mdit_desc as mb, mb.mdit_cod as cod_mb,\n\t\t\tmemo.mdit_desc as memoria, memo.mdit_cod as cod_memoria,\n\t\t\tsom.mdit_fabricante as fabricante_som, som.mdit_desc as som, som.mdit_cod as cod_som,\n\n\n\t\t\tfab.fab_nome as fab_nome, fab.fab_cod as fab_cod,\n\n\t\t\tfo.forn_cod as fornecedor_cod, fo.forn_nome as fornecedor_nome,\n\n\t\t\tmodel.marc_cod as modelo_cod, model.marc_nome as modelo,\n\n\t\t\tpol.pole_cod as polegada_cod, pol.pole_nome as polegada_nome,\n\n\t\t\tres.resol_cod as resolucao_cod, res.resol_nome as resol_nome\n\n\n\t\tFROM ((((((((((((((((((moldes as mold\n\t\t\tleft join tipo_imp as t on\tt.tipo_imp_cod = mold.mold_tipo_imp)\n\t\t\tleft join polegada as pol on mold.mold_polegada = pol.pole_cod)\n\t\t\tleft join resolucao as res on mold.mold_resolucao = res.resol_cod)\n\t\t\tleft join fabricantes as fab on fab.fab_cod = mold.mold_fab)\n\t\t\tleft join fornecedores as fo on fo.forn_cod = mold.mold_fornecedor)\n\n\t\t\tleft join modelos_itens as proc on proc.mdit_cod = mold.mold_proc)\n\t\t\tleft join modelos_itens as hd on hd.mdit_cod = mold.mold_modelohd)\n\t\t\tleft join modelos_itens as vid on vid.mdit_cod = mold.mold_video)\n\t\t\tleft join modelos_itens as red on red.mdit_cod = mold.mold_rede)\n\t\t\tleft join modelos_itens as modm on modm.mdit_cod = mold.mold_modem)\n\t\t\tleft join modelos_itens as cd on cd.mdit_cod = mold.mold_cdrom)\n\t\t\tleft join modelos_itens as grav on grav.mdit_cod = mold.mold_grav)\n\t\t\tleft join modelos_itens as dvd on dvd.mdit_cod = mold.mold_dvd)\n\t\t\tleft join modelos_itens as mb on mb.mdit_cod = mold.mold_mb)\n\t\t\tleft join modelos_itens as memo on memo.mdit_cod = mold.mold_memo)\n\t\t\tleft join modelos_itens as som on som.mdit_cod = mold.mold_som)\n\n\t\t\tleft join instituicao as inst on inst.inst_cod = mold.mold_inst)\n\t\t\tleft join localizacao as loc on loc.loc_id = mold.mold_local),\n\n\n\t\t\tmarcas_comp as model, tipo_equip as equip\n\t\tWHERE\n\n\t\t\t(mold.mold_tipo_equip = equip.tipo_cod) and\n\t\t\t(mold.mold_marca = model.marc_cod) order by fab_nome";
//(mold.mold_marca = $comp_marca) and
$resultadoA = mysql_query($queryA);
$linhasA = mysql_num_rows($resultadoA);
$row = mysql_fetch_array($resultadoA);
/* if (mysql_num_rows($resultadoA)>0)
{
$linhasA = mysql_num_rows($resultadoA)-1;
示例14: observerMemory
function observerMemory()
{
$cookie = cookie::get(self::$auth_cookie_name);
if ($cookie) {
$err = false;
list($username, $userid, $hash) = explode(',', $cookie);
$userid = intval($userid);
db::table('admin_users');
db::where('user_id', $userid);
$row = db::assoc();
$word = 'legenda';
if (md5($row['user_login'] . $word) != $hash) {
$err = true;
}
if (db::rows() == 0) {
$err = true;
}
if ($err) {
self::logout();
} else {
$_SESSION['ADMIN_AUTH'] = 1;
$_SESSION['ADMIN_USER_ID'] = $userid;
headers::self();
}
}
}
示例15: session_start
(at your option) any later version.
OCOMON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Foobar; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
session_start();
include "../../includes/include_geral.inc.php";
include "../../includes/include_geral_II.inc.php";
include 'includes/header.php';
$cab = new headers();
$cab->set_title($TRANS["html_title"]);
$auth = new auth();
$auth->testa_user($_SESSION['s_usuario'], $_SESSION['s_nivel'], $_SESSION['s_nivel_desc'], 4);
$hojeLog = date("d-m-Y H:i:s");
$fecha = "";
if (isset($_GET['popup'])) {
$fecha = "window.close()";
} else {
$fecha = "redirect('" . basename($_SERVER['PHP_SELF']) . "')";
}
print "<BR><B>" . TRANS('TTL_ADMIN_SW_STAND') . "</B><BR>";
print "<FORM method='POST' action='" . $_SERVER['PHP_SELF'] . "' onSubmit=\"return valida()\">";
if (!isset($_GET['cellStyle'])) {
$cellStyle = "cellpadding='5' cellspacing='0'";
} else {