本文整理汇总了PHP中sendStatusCode函数的典型用法代码示例。如果您正苦于以下问题:PHP sendStatusCode函数的具体用法?PHP sendStatusCode怎么用?PHP sendStatusCode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sendStatusCode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
include 'admin/packages.php';
} elseif ($action == 'admin') {
include 'admin/packages_admin.php';
} elseif ($action == 'profilefield') {
include 'admin/profilefield.php';
} elseif ($action == 'posts') {
include 'admin/posts.php';
} elseif ($action == 'logout') {
$slog->sid_logout();
echo head();
ok('admin.php', $lang->phrase('admin_successfully_logged_off'));
} elseif ($action == 'locate') {
$url = $gpc->get('url', none);
if (!empty($url)) {
$db->close();
sendStatusCode(307, $url);
exit;
} else {
echo head();
if (!empty($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], 'action=locate') === false) {
$url = htmlspecialchars($_SERVER['HTTP_REFERER']);
} else {
$url = 'javascript:history.back(-1);';
}
error($url, $lang->phrase('admin_choose_valid_location_option'));
}
} else {
if (strlen($action) == 0) {
include 'admin/frames.php';
} else {
$error = true;
示例2: eval
$_POST['name'] = $user[0];
} else {
$error[] = $lang->phrase('pm_toname_notfound');
}
}
($code = $plugins->load('pm_save_errorhandling')) ? eval($code) : null;
BBProfile($bbcode);
$_POST['topic'] = $bbcode->parseTitle($_POST['topic']);
if (count($error) > 0 || !empty($_POST['Preview'])) {
$data = array('topic' => $_POST['topic'], 'comment' => $_POST['comment'], 'name' => $_POST['name'], 'outgoing' => $_POST['temp']);
($code = $plugins->load('pm_save_errordata')) ? eval($code) : null;
$fid = save_error_data($data);
if (!empty($_POST['Preview'])) {
$slog->updatelogged();
$db->close();
sendStatusCode(307, $config['furl'] . '/pm.php?action=preview&fid=' . $fid . SID2URL_JS_x);
exit;
} else {
error($error, "pm.php?action=new&fid=" . $fid . SID2URL_x);
}
} else {
set_flood();
$date = time();
($code = $plugins->load('pm_save_queries')) ? eval($code) : null;
$db->query("\n\t\tINSERT INTO {$db->pre}pm (topic,pm_from,pm_to,comment,date,dir)\n\t\tVALUES ('{$_POST['topic']}','{$my->id}','{$_POST['name']}','{$_POST['comment']}','{$date}','1')\n\t\t");
if ($_POST['temp'] == 1) {
$db->query("\n\t\t\tINSERT INTO {$db->pre}pm (topic,pm_from,pm_to,comment,date,dir,status)\n\t\t\tVALUES ('{$_POST['topic']}','{$_POST['name']}','{$my->id}','{$_POST['comment']}','{$date}','2','1')\n\t\t\t");
}
$lang_dir = $lang->getdir(true);
$result = $db->query("SELECT name, mail, opt_pmnotify, language FROM {$db->pre}user WHERE id = '{$_POST['name']}'");
$row = $slog->cleanUserData($db->fetch_assoc($result));
示例3: elseif
}
} elseif ($_GET['action'] == "about2") {
if ($my->p['useabout'] == 0) {
errorLogin($lang->phrase('not_allowed'), "editprofile.php");
}
$error = array();
if (strxlen($_POST['about']) > $config['maxaboutlength']) {
$error[] = $lang->phrase('about_too_long');
}
($code = $plugins->load('editprofile_about2_start')) ? eval($code) : null;
if (count($error) > 0 || !empty($_POST['Preview'])) {
$fid = save_error_data($_POST['about']);
if (!empty($_POST['Preview'])) {
$slog->updatelogged();
$db->close();
sendStatusCode(307, $config['furl'] . '/editprofile.php?action=about&job=preview&fid=' . $fid . SID2URL_JS_x);
exit;
} else {
error($error, "editprofile.php?action=about&fid=" . $fid . SID2URL_x);
}
} else {
($code = $plugins->load('editprofile_about2_query')) ? eval($code) : null;
$db->query("UPDATE {$db->pre}user SET about = '{$_POST['about']}' WHERE id = '{$my->id}'");
ok($lang->phrase('data_success'), "editprofile.php?action=about" . SID2URL_x);
}
} elseif ($_GET['action'] == "about") {
if ($my->p['useabout'] == 0) {
errorLogin($lang->phrase('not_allowed'), "editprofile.php");
}
$breadcrumb->Add($lang->phrase('editprofile_about'));
echo $tpl->parse("header");
示例4: sendStatusCode
$db->close();
sendStatusCode(307, 'showtopic.php?id=' . $info['id'] . '&page=' . $pgs . $qUrl . SID2URL_JS_x . '#p' . $mylast[1]);
exit;
} elseif ($_GET['action'] == 'jumpto') {
$result = $db->query("SELECT date, id FROM {$db->pre}replies WHERE topic_id = '{$info['id']}' AND id = '{$_GET['topic_id']}'");
$mylast = $db->fetch_num($result);
$sql_order = iif($last['post_order'] == 1, '<', '>');
$result = $db->query("SELECT COUNT(*) AS count FROM {$db->pre}replies WHERE topic_id = '{$info['id']}' AND date {$sql_order} '{$mylast[0]}'");
$new = $db->fetch_assoc($result);
$tp = $info['posts'] + 1 - $new['count'];
$pgs = ceil($tp / $last['topiczahl']);
if ($pgs < 1) {
$pgs = 1;
}
$db->close();
sendStatusCode(307, 'showtopic.php?id=' . $info['id'] . '&page=' . $pgs . $qUrl . SID2URL_JS_x . '#p' . $mylast[1]);
exit;
}
($code = $plugins->load('showtopic_redirect')) ? eval($code) : null;
$prefix = '';
if ($info['prefix'] > 0) {
$prefix_obj = $scache->load('prefix');
$prefix_arr = $prefix_obj->get($info['board']);
if (isset($prefix_arr[$info['prefix']])) {
$prefix = $prefix_arr[$info['prefix']]['value'];
$prefix = $lang->phrase('showtopic_prefix_title');
}
}
$topforums = get_headboards($fc, $last, TRUE);
$breadcrumb->Add($last['name'], "showforum.php?id=" . $last['id'] . SID2URL_x);
$breadcrumb->Add($prefix . $info['topic']);
示例5: array
$result = $db->query("SELECT * FROM {$db->pre}filetypes WHERE extension LIKE '%{$_GET['type']}%'");
$nr = $db->num_rows($result);
$cache = array();
while ($row = $db->fetch_assoc($result)) {
$row['extension'] = str_replace(',', ', ', $row['extension']);
$cache[] = $row;
}
echo $tpl->parse("popup/header");
($code = $plugins->load('popup_filetypes_prepared')) ? eval($code) : null;
echo $tpl->parse("popup/filetypes");
($code = $plugins->load('popup_filetypes_end')) ? eval($code) : null;
}
elseif ($_GET['action'] == "showpost") {
sendStatusCode(307, 'showtopic.php?action=jumpto&topic_id='.$_GET['id'].SID2URL_JS_x);
}
elseif ($_GET['action'] == "edithistory") {
echo $tpl->parse("popup/header");
($code = $plugins->load('popup_edithistory_query')) ? eval($code) : null;
$result = $db->query("
SELECT r.ip, r.topic_id, r.board, r.edit, r.id, r.topic, r.date, u.name as uname, r.name as gname, u.id as mid, u.groups, r.email as gmail, r.guest
FROM {$db->pre}replies AS r
LEFT JOIN {$db->pre}user AS u ON r.name = u.id AND r.guest = '0'
WHERE r.id = '{$_GET['id']}'
LIMIT 1
");
$found = $db->num_rows($result);
if ($found == 1) {
示例6: implode
$htaccess[] = "";
}
$filesystem->file_put_contents('.htaccess', implode("\r\n", $htaccess));
}
$breadcrumb = new breadcrumb();
$breadcrumb->Add($config['fname'], 'index.php');
$phpdoc = new OutputDoc($config['gzip']);
$phpdoc->Start($config['gzcompression']);
define('PAGE_IS_GZIPPED', $config['gzip'] == 1 && $phpdoc->Encoding());
($code = $plugins->load('frontend_init')) ? eval($code) : null;
// Global and important functions (not for cron and external)
if (defined('TEMPNOFUNCINIT') == false || $config['foffline'] && defined('TEMPSHOWLOG') == false) {
define('SCRIPT_START_TIME', benchmarktime());
$slog = new slog();
$my = $slog->logged();
$lang->init($my->language);
$tpl = new tpl();
$slog->checkBan();
}
if ($config['foffline'] && defined('TEMPSHOWLOG') == false) {
$my->p = $slog->Permissions();
if ($my->p['admin'] != 1) {
$offline = file_get_contents('data/offline.php');
sendStatusCode(503, 3600);
($code = $plugins->load('frontend_init_offline')) ? eval($code) : null;
echo $tpl->parse("offline");
$phpdoc->Out();
$db->close();
exit;
}
}
示例7: head
$id = $gpc->get('id', int);
$result = $db->query('SELECT id, active, required, position FROM ' . $db->pre . 'plugins WHERE id = "' . $id . '"');
$row = $db->fetch_assoc($result);
if ($db->num_rows($result) == 0) {
echo head();
error('admin.php?action=packages&job=plugins', $lang->phrase('admin_packages_err_specified_id_is_not_correct'));
} elseif ($row['required'] == 1) {
echo head();
error('admin.php?action=packages&job=plugins', $lang->phrase('admin_packages_err_this_plugin_is_required_you_cannot_change_the_status'));
} else {
$active = $row['active'] == 1 ? 0 : 1;
$db->query('UPDATE ' . $db->pre . 'plugins SET active = "' . $active . '" WHERE id = "' . $id . '"');
$filesystem->unlink('cache/modules/' . $plugins->_group($row['position']) . '.php');
$delobj = $scache->load('components');
$delobj->delete();
sendStatusCode(307, $config['furl'] . '/admin.php?action=packages&job=plugins');
}
} elseif ($job == 'plugins_delete') {
echo head();
$id = $gpc->get('id', int);
$result = $db->query("SELECT id, required FROM {$db->pre}plugins WHERE id = '{$id}' LIMIT 1");
$row = $db->fetch_assoc($result);
if ($db->num_rows($result) == 0) {
error('admin.php?action=packages&job=plugins', $lang->phrase('admin_packages_err_specified_plugin_not_found'));
} elseif ($row['required'] == 1) {
error('admin.php?action=packages&job=plugins', $lang->phrase('admin_packages_err_specified_plugin_is_required_by_a_package_and_cannot_be_deleted'));
} else {
?>
<table class="border" border="0" cellspacing="0" cellpadding="4" align="center">
<tr><td class="obox"><?php
echo $lang->phrase('admin_packages_head_delete_plugin');
示例8: error
if ($attempts > 0) {
$can_try = $lang->phrase('log_x_attempts');
} else {
$can_try = '';
}
error($lang->phrase('log_wrong_data'), "log.php?action=login&redirect=" . rawurlencode($loc) . SID2URL_x);
}
} else {
clear_login_attempts();
ok($lang->phrase('log_msglogin'), $loc);
}
} elseif ($_GET['action'] == "logout") {
if (!$my->vlogin) {
$slog->updatelogged();
$db->close();
sendStatusCode(307, $config['furl'] . '/log.php');
exit;
} else {
$loc = getRedirectURL();
($code = $plugins->load('log_logout')) ? eval($code) : null;
$slog->sid_logout();
ok($lang->phrase('log_msglogout'), $loc);
}
} elseif ($_GET['action'] == "pwremind") {
if ($my->vlogin) {
error($lang->phrase('log_already_logged'));
}
$breadcrumb->Add($lang->phrase('log_pwremind_title'));
echo $tpl->parse("header");
echo $tpl->parse("menu");
($code = $plugins->load('log_pwremind_form_start')) ? eval($code) : null;
示例9: eval
$error[] = $lang->phrase('edit_reason_too_short');
}
if (!isset($prefix[$_POST['opt_0']]) && $last['prefix'] == 1) {
$error[] = $lang->phrase('prefix_not_optional');
}
($code = $plugins->load('edit_save_errorhandling')) ? eval($code) : null;
BBProfile($bbcode);
$_POST['topic'] = $bbcode->parseTitle($_POST['topic']);
if (count($error) > 0 || !empty($_POST['Preview'])) {
$data = array('topic' => $_POST['topic'], 'comment' => $_POST['comment'], 'prefix' => $_POST['opt_0'], 'dosmileys' => $_POST['dosmileys'], 'dowords' => $_POST['dowords'], 'about' => $_POST['about']);
($code = $plugins->load('edit_save_errordata')) ? eval($code) : null;
$fid = save_error_data($data);
if (!empty($_POST['Preview'])) {
$slog->updatelogged();
$db->close();
sendStatusCode(307, $config['furl'] . "/edit.php?action=preview&id={$info['id']}&fid=" . $fid . SID2URL_JS_x);
exit;
} else {
error($error, "edit.php?id={$info['id']}&fid=" . $fid . SID2URL_x);
}
} else {
$info['edit'] .= $my->name . "\t" . time() . "\t" . $_POST['about'] . "\t" . $my->ip . "\n";
($code = $plugins->load('edit_save_queries')) ? eval($code) : null;
$db->query("\n\t\t\t\tUPDATE {$db->pre}replies\n\t\t\t\tSET edit = '{$info['edit']}', topic = '{$_POST['topic']}', comment = '{$_POST['comment']}', dosmileys = '{$_POST['dosmileys']}', dowords = '{$_POST['dowords']}'\n\t\t\t\tWHERE id = '{$_GET['id']}'\n\t\t\t\t");
if ($info['tstart'] == '1') {
$db->query("\n\t\t\t\t\tUPDATE {$db->pre}topics\n\t\t\t\t\tSET prefix = '{$_POST['opt_0']}', topic = '{$_POST['topic']}'\n\t\t\t\t\tWHERE id = '{$info['topic_id']}'\n\t\t\t\t\t");
}
ok($lang->phrase('data_success'), 'showtopic.php?action=jumpto&id=' . $info['topic_id'] . '&topic_id=' . $info['id'] . SID2URL_x);
}
}
} else {
示例10: eval
}
$having .= " LEFT JOIN {$db->pre}forums AS f ON f.id = r.board ";
$sql_where .= " AND f.invisible != '2' ";
($code = $plugins->load('search_search_query')) ? eval($code) : null;
$result = $db->query("\n\tSELECT r.topic_id\n\tFROM {$db->pre}replies AS r {$having}\n\tWHERE {$sql_where}\n\tGROUP BY r.topic_id\n\tLIMIT {$config['maxsearchresults']}\n\t");
$searchresult = array();
while ($row = $db->fetch_assoc($result)) {
$searchresult[] = $row['topic_id'];
}
if (count($searchresult) > 0) {
$data = array('ids' => $searchresult, 'ignored' => $ignored, 'used' => $used, 'search' => $gpc->get('search', str), 'name' => $gpc->get('name', str), 'boards' => $gpc->get('boards', arr_int), 'opt_0' => $gpc->get('opt_0', int), 'opt_1' => $gpc->get('opt_1', int), 'opt_2' => $gpc->get('opt_2', int), 'temp' => $gpc->get('temp', int), 'temp2' => $gpc->get('temp2', int), 'sort' => $gpc->get('sort', str), 'order' => $gpc->get('order', str));
$fid = md5(microtime());
file_put_contents('cache/search/' . $fid . '.inc.php', serialize($data));
$slog->updatelogged();
$db->close();
sendStatusCode(307, $config['furl'] . '/search.php?action=result&fid=' . $fid . SID2URL_JS_x);
exit;
} else {
error($lang->phrase('search_nothingfound'), 'search.php' . SID2URL_1);
}
} elseif ($_GET['action'] == "result") {
$fid = $gpc->get('fid');
if (!is_hash($fid)) {
error($lang->phrase('query_string_error'), 'search.php' . SID2URL_1);
}
$file = "cache/search/{$fid}.inc.php";
if (!file_exists($file)) {
error($lang->phrase('search_doesntexist'), 'search.php' . SID2URL_1);
}
$data = file_get_contents($file);
$data = unserialize($data);
示例11: foot
echo $lang->phrase('admin_lang_form_save');
?>
" /></td>
</tr>
</table>
</form>
<?php
echo foot();
} elseif ($job == 'phrase_add2') {
echo head();
$varname = $gpc->get('varname', none);
$text = $gpc->get('text', none);
$file = base64_decode($gpc->get('file', none));
$language = $gpc->get('langt', none);
$c = new manageconfig();
foreach ($language as $id => $t) {
if (empty($t)) {
$t = $text;
}
$c->getdata("language/{$id}/{$file}", 'lang');
$c->updateconfig($varname, str, $t);
$c->savedata();
}
if (strpos($file, 'javascript.lng.php') !== false) {
$delobj = $scache->load('loadlanguage');
$delobj->delete();
}
ok('admin.php?action=language&job=phrase_file&file=' . urlencode(base64_encode($file)));
} else {
sendStatusCode(307, $config['furl'] . '/admin.php?action=language&job=manage');
}
示例12: file
$d = $gpc->get('id', str);
$key = $gpc->get('key', int);
if ($key == 3 || $key == 4) {
$data = file('data/feedcreator.inc.php');
$n = array();
foreach ($data as $r) {
$row = explode('|', $r);
$row = array_map('trim', $row);
if (strtoupper($row[0]) == strtoupper($d)) {
$row[$key] = invert($row[$key]);
}
$n[] = implode('|', $row);
}
$filesystem->file_put_contents('data/feedcreator.inc.php', implode("\n", $n));
}
sendStatusCode(307, $config['furl'].'/admin.php?action=misc&job=feedcreator');
}
elseif ($job == 'feedcreator_add') {
echo head();
$name = $gpc->get('name', str);
$class = $gpc->get('class', str);
$active = $gpc->get('active', str);
$dl = $gpc->get('dl', str);
$dir = realpath('./classes/feedcreator/').DIRECTORY_SEPARATOR;
$inserterrors = array();
require("classes/class.upload.php");
$my_uploader = new uploader();
$my_uploader->max_filesize(200*1024);
$my_uploader->file_types(array('php'));
示例13: UpdateBoardLastStats
UpdateBoardLastStats($_POST['opt_0']);
}
ok($lang->phrase('x_entries_moved'), 'showforum.php?id=' . $board . SID2URL_x);
} elseif ($_GET['action'] == "delete") {
if ($my->mp[0] == 1 && $my->mp[4] == 0) {
errorLogin($lang->phrase('not_allowed'), 'manageforum.php?action=index&id=' . $board . '&type=' . $_GET['action'] . SID2URL_x);
}
if (count($_POST['delete']) == 0) {
$slog->updatelogged();
$db->close();
if (empty($_GET['action'])) {
$url = 'showforum.php?id=' . $board . SID2URL_JS_x;
} else {
$url = 'manageforum.php?action=index&id=' . $board . '&type=' . $_GET['action'] . SID2URL_JS_x;
}
sendStatusCode(307, $config['furl'] . '/' . $url);
exit;
}
$ids = implode(',', $_POST['delete']);
if ($config['updatepostcounter'] == 1 && $info['count_posts'] == 1) {
$result = $db->query("SELECT COUNT(*) AS posts, name FROM {$db->pre}replies WHERE guest = '0' AND topic_id IN({$ids}) GROUP BY name");
while ($row = $db->fetch_assoc($result)) {
$db->query("UPDATE {$db->pre}user SET posts = posts-{$row['posts']} WHERE id = '{$row['name']}'");
}
}
$db->query("DELETE FROM {$db->pre}replies WHERE topic_id IN({$ids})");
$anz = $db->affected_rows();
$uresult = $db->query("SELECT id, source FROM {$db->pre}uploads WHERE topic_id IN({$ids})");
while ($urow = $db->fetch_assoc($uresult)) {
$filesystem->unlink('uploads/topics/' . $urow['source']);
$thumb = 'uploads/topics/thumbnails/' . $urow['id'] . get_extension($urow['source'], true);
示例14: VALUES
$uploaddata['file'] = $db->escape_string($uploaddata['file']);
$uploaddata['source'] = $db->escape_string($uploaddata['source']);
$db->query("INSERT INTO {$db->pre}uploads (file,source,tid,mid,topic_id) VALUES ('{$uploaddata['file']}','{$uploaddata['source']}','{$tid}','{$upper}','{$upinfo['topic_id']}')");
}
}
($code = $plugins->load('attachments_upload_save_add_end')) ? eval($code) : null;
if (count($inserterrors) > 0) {
echo $tpl->parse('popup/header');
error($inserterrors, 'attachments.php?type='.$_GET['type'].'&id='.$_GET['id'].SID2URL_x);
}
else {
$slog->updatelogged();
$db->close();
sendStatusCode(307, $config['furl'].'/attachments.php?type='.$_GET['type'].'&id='.$_GET['id'].SID2URL_JS_x);
exit;
}
}
}
else {
echo $tpl->parse("popup/header");
$filetypes = implode($lang->phrase('listspacer'), explode(',',$config['tpcfiletypes']));
$filesize = formatFilesize($config['tpcfilesize']);
if ($_GET['type'] == 'edit' && ($my->mp[0] == 1 || $upinfo['name'] == $my->id)) {
$result = $db->query('SELECT id, file, source FROM '.$db->pre.'uploads WHERE mid = "'.$upinfo['name'].'" AND tid = "'.$upinfo['id'].'"');
}
elseif ($_GET['type'] == 'newtopic' || $_GET['type'] == 'addreply') {
$result = $db->query('SELECT id, file, source FROM '.$db->pre.'uploads WHERE mid = "'.$my->id.'" AND topic_id = "'.$upinfo['id'].'" AND tid = "0"');
示例15: round
$row->rating = round(array_sum($ratings)/$ratingcounter*50)+50;
}
else {
$row->rating = $lang->phrase('profile_na');
}
}
($code = $plugins->load('profile_member_prepared')) ? eval($code) : null;
echo $tpl->parse("profile/index");
($code = $plugins->load('profile_member_end')) ? eval($code) : null;
}
else {
$group = 'fallback_no_username_group';
($code = $plugins->load('profile_member_fallback')) ? eval($code) : null;
echo $tpl->parse("profile/guest");
}
}
else {
$db->close();
sendStatusCode(301, 'members.php');
exit;
}
($code = $plugins->load('profile_end')) ? eval($code) : null;
$slog->updatelogged();
$zeitmessung = t2();
echo $tpl->parse("footer");
$phpdoc->Out();
$db->close();
?>