本文整理汇总了PHP中pheader函数的典型用法代码示例。如果您正苦于以下问题:PHP pheader函数的具体用法?PHP pheader怎么用?PHP pheader使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pheader函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
function add()
{
global $viewhelper;
if (isset($_POST['do']) && !empty($_POST['data']['market']['name'])) {
pb_submit_check("data");
$this->market->setParams();
$this->market->params['data']['market']['industry_id'] = PbController::getMultiId($_POST['industry']['id']);
$this->market->params['data']['market']['area_id'] = PbController::getMultiId($_POST['area']['id']);
$result = $this->market->Add();
if ($result) {
flash('thanks_for_adding_market');
} else {
pheader("location:add.php");
}
}
$viewhelper->setPosition(L("added_market_info", "tpl"));
render("market/add");
}
示例2: reactive
function reactive()
{
global $G;
if (!empty($_GET['em'])) {
//check em
$email = $_GET['em'];
$result = $this->member->checkUserExistsByEmail($email);
if (!$result) {
flash("member_not_exists", null, 0);
} else {
$member_reg_auth = $G['setting']['new_userauth'];
$id = $this->member->field("id", "email='" . $email . "'");
$member_info = $this->member->getInfoById($id);
require LIB_PATH . "sendmail.inc.php";
require CACHE_LANG_PATH . "lang_emails.php";
if ($member_reg_auth == 1) {
$if_need_check = true;
$exp_time = $this->member->timestamp + 86400;
$tmp_username = $member_info['username'];
$hash = authcode("{$tmp_username}\t" . $exp_time, "ENCODE");
//$hash = str_replace(array("+", "|"), array("|", "_"), $hash);
$hash = rawurlencode($hash);
setvar("hash", $hash);
setvar("expire_date", date("Y-m-d H:i", strtotime("+1 day")));
$sended = pb_sendmail(array($email, $member_info['username']), $member_info['username'] . "," . $arrTemplate["_pls_active_your_account"], "activite");
if (empty($G['setting']['reg_filename'])) {
$gopage = URL . 'register.php?action=done&em=' . urlencode($email);
} else {
$gopage = URL . $G['setting']['reg_filename'] . '?action=done&em=' . urlencode($email);
}
pheader("location:" . $gopage);
}
}
} else {
flash("invalid_request", null, 0);
}
}
示例3: direct
function direct()
{
global $pdb, $tb_prefix;
$result = $pdb->GetRow("SELECT * FROM " . $tb_prefix . "companies WHERE adwords='" . $this->keyword . "' OR name='" . $this->keyword . "'");
if (!empty($result)) {
pheader("Location:" . URL . "space/?id=" . $result['id']);
exit;
} else {
flash("record_not_exists", '', 0);
}
}
示例4: Start
function Start()
{
global $topleveldomain_support, $pdb, $tb_prefix;
if ($topleveldomain_support) {
$host = isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '');
$result = $pdb->GetRow("SELECT id,cache_spacename FROM {$tb_prefix}companies WHERE topleveldomain='" . $host . "' AND status='1'");
if (!empty($result)) {
pheader("HTTP/1.1 301 Moved Permanently");
pheader("location:" . URL . "space.php?id=" . $result['id']);
exit;
}
}
formhash();
}
示例5: flash
} else {
flash();
}
}
if (isset($_POST['save_cache'])) {
$updated = $setting->replace($_POST['data']['setting']);
if ($updated) {
$cache->writeCache("setting", "setting");
pheader("location:setting.php?do=cache");
}
}
if (isset($_POST['save_mail'])) {
$updated = $setting->replace($_POST['data']['setting']);
if ($updated) {
$cache->writeCache("setting", "setting");
pheader("location:setting.php?do=email");
}
}
function edit_function($data)
{
if (empty($data) && !is_array($data)) {
return;
}
$configfile = PHPB2B_ROOT . 'configs' . DS . 'config.inc.php';
$configfiles = file_get_contents($configfile);
$configfiles = trim($configfiles);
foreach ($data as $key => $val) {
$pattern[$key] = "/[\$]" . $key . "\\s*\\=\\s*.*?;/is";
$replacement[$key] = "\$" . $key . " = " . $val . ";";
if ($key == "subdomain_support") {
if ($val == 1) {
示例6: pb_sendmail
/**
* PHPB2B : Opensource B2B Script (http://www.phpb2b.com/)
* Copyright (C) 2007-2010, Ualink. All Rights Reserved.
*
* Licensed under The Languages Packages Licenses.
* Support : phpb2b@hotmail.com
*
* @version $Revision: 1393 $
*/
function pb_sendmail($to_users = array(), $subject, $template = null, $body = null, $redirect_url = null)
{
global $charset, $smarty, $theme_name, $_PB_CACHE;
require_once LIB_PATH . "phpmailer/class.phpmailer.php";
$content = null;
$mail = new PHPMailer();
$result = false;
$logdata['created'] = time();
if (!empty($_PB_CACHE['setting']['mail'])) {
extract(unserialize($_PB_CACHE['setting']['mail']));
}
if ($send_mail == 2) {
$mail->IsSMTP();
$mail->Host = $smtp_server;
$mail->Port = $smtp_port;
if ($smtp_auth) {
$mail->SMTPAuth = true;
}
if (!empty($auth_protocol)) {
$mail->SMTPSecure = $auth_protocol;
}
$mail->Username = $auth_username;
$mail->Password = $auth_password;
} else {
$mail->IsMail();
}
$mail->IsHTML(true);
$mail->CharSet = $charset;
$mail->Encoding = "base64";
$mail->From = $mail_from;
$mail->FromName = empty($mail_fromwho) ? $_PB_CACHE['setting']['site_name'] : $mail_fromwho;
$mail->Subject = $subject;
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
// optional, comment out and test
$tpl_file = $theme_name . "/emails/" . $template . $smarty->tpl_ext;
if (!empty($template) && $smarty->template_exists($tpl_file)) {
$content = $smarty->fetch($tpl_file);
} elseif (!empty($body)) {
$content = $body;
}
$mail->MsgHTML($content);
if (!empty($to_users)) {
if (!is_array($to_users[0])) {
$mail->AddAddress($to_users[0], $to_users[1]);
$result = $mail->Send();
} elseif (is_array($to_users[0])) {
$mail->ClearAddresses();
foreach ($to_users as $key => $val) {
$mail->AddAddress($val[0], $val[1]);
$result = $mail->Send();
}
}
}
if ($mail->error_count > 0) {
if (class_exists("Logs")) {
$log = new Logs();
} else {
uses("log");
$log = new Logs();
}
$logdata['handle_type'] = "error";
$logdata['source_module'] = "sendmail";
$logdata['description'] = $mail->ErrorInfo;
$log->Add($logdata);
return false;
}
if (!empty($redirect_url)) {
pheader("Location:" . $redirect_url);
} else {
return $result;
}
}
示例7: flash
}
$sql = "UPDATE {$tb_prefix}attachments a,{$tb_prefix}albums ab SET a.title='" . $title . "',a.description='" . $description . "',ab.attachment_id={$attachment_id},type_id='" . $vals['type_id'] . "' WHERE ab.id={$id} AND a.id=" . $attachment_id;
} else {
if ($g['max_album'] && $now_album_amount >= $g['max_album']) {
flash('one_day_max');
}
if (empty($_FILES['pic']['name'])) {
flash("failed");
}
$sql = "INSERT INTO {$tb_prefix}albums (member_id,attachment_id,type_id) VALUES (" . $_SESSION['MemberID'] . ",'" . $attachment_controller->id . "','" . $vals['type_id'] . "')";
}
$result = $pdb->Execute($sql);
if (!$result) {
flash();
} else {
pheader("Location:album.php");
}
}
setvar("AlbumTypes", $_PB_CACHE['albumtype']);
if (isset($_GET['do'])) {
$do = trim($_GET['do']);
if (!empty($_GET['id'])) {
$id = intval($_GET['id']);
}
if ($do == "del" && !empty($id)) {
$result = $album->del(intval($id), "member_id=" . $_SESSION['MemberID']);
}
if ($do == "edit") {
if (!empty($id)) {
$album_info = $pdb->GetRow("SELECT a.title,a.description,ab.id,a.attachment,ab.type_id FROM {$tb_prefix}albums ab LEFT JOIN {$tb_prefix}attachments a ON a.id=ab.attachment_id WHERE ab.member_id=" . $_SESSION['MemberID'] . " AND ab.id={$id}");
if (!empty($album_info['attachment'])) {
示例8: pb_submit_check
if (isset($_POST['do'])) {
pb_submit_check('do');
uses("order");
$order = new Orders();
$result = $adzone->read("*", intval($_POST['id']));
if (!empty($result)) {
$data['member_id'] = $the_memberid;
$data['cache_username'] = $memberinfo['username'];
$data['subject'] = $result['name'];
$data['pay_id'] = $_POST['pay_id'];
$data['pay_name'] = $_POST['pay_name'];
$data['total_price'] = $result['price'];
$new_trade_no = $order->Add($data);
if (!empty($_POST['paynow'])) {
//header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate');
pheader("Location:../purchase.php?do=pay&tradeno=" . $new_trade_no);
exit;
} else {
flash('success', 'order.php');
}
}
}
if (isset($_GET['do'])) {
$do = trim($_GET['do']);
$id = intval($_GET['id']);
if ($do == "buy" && !empty($id)) {
$result = $adzone->read("*", $id);
if (!empty($result)) {
setvar("payments", $payment);
setvar("item", $result);
vtemplate("ads_edit");
示例9: isset
require "libraries/common.inc.php";
require "share.inc.php";
if (!empty($_GET['do'])) {
$action = isset($_GET['action']) ? htmlspecialchars(trim($_GET['action'])) : 'index';
$do = $_GET['do'] == '' ? 'home' : htmlspecialchars(trim($_GET['do']));
$c_file = LIB_PATH . 'core/controllers/' . $do . '_controller.php';
$c_do = ucwords($do);
$secure_c = array("rss", "offer", "news", "job", "fair", "space", "pc", "wap", "pad", "help", "friendlink", "page", "standard", "brand", "company", "announce", "error", "product", "market", "member", "message", "topic", "service", "search", "dict");
if (in_array($do, $secure_c)) {
if (is_file($c_file)) {
require $c_file;
$pc = new $c_do();
if ($action == 'list') {
$action = 'lists';
}
if (method_exists($pc, $action)) {
call_user_func_array(array($pc, $action), array());
} elseif (method_exists($pc, 'index')) {
$pc->index();
}
} else {
render("index");
}
} else {
flash();
}
} elseif (pb_ismobile()) {
pheader("location:index.php?do=wap");
} else {
render("index");
}
示例10: define
<?php
/**
* [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
* The contents of this file are subject to the License; you may not use this file except in compliance with the License.
*
* @version $Revision: 2075 $
*/
define('CURSCRIPT', 'index');
require "../libraries/common.inc.php";
if (empty($_COOKIE[$cookiepre . 'admin']) || !$_COOKIE[$cookiepre . 'admin']) {
pheader("location:login.php");
}
require "session_cp.inc.php";
require "menu.php";
if (!empty($adminer->info['permissions']) && $adminer->info['member_id'] != $administrator_id) {
$allowed_permissions = explode(",", $adminer->info['permissions']);
foreach ($menus as $key => $val) {
if (!in_array($key, $allowed_permissions)) {
unset($menus[$key]);
} else {
foreach ($val['children'] as $key1 => $val1) {
if (!in_array($key1, $allowed_permissions)) {
unset($menus[$key]['children'][$key1]);
}
}
}
}
}
require LIB_PATH . "json_config.php";
$smarty->template_dir = "template/";
示例11: foreach
}
}
if (isset($_POST['save_permission'])) {
foreach ($result as $key => $val) {
$exempt = null;
$exempt .= in_array($val['id'], $_POST['basic']) ? "1" : "0";
$exempt .= in_array($val['id'], $_POST['offer']) ? "1" : "0";
$exempt .= in_array($val['id'], $_POST['product']) ? "1" : "0";
$exempt .= in_array($val['id'], $_POST['company']) ? "1" : "0";
$exempt .= in_array($val['id'], $_POST['pms']) ? "1" : "0";
$exempt_value = bindec($exempt);
$sql = "UPDATE {$tb_prefix}membergroups SET exempt='{$exempt_value}',modified={$time_stamp} WHERE id={$val['id']}";
$pdb->Execute($sql);
}
$cache->writeCache('membergroup', 'membergroup');
pheader("location:membergroup.php?do=permission");
}
if (isset($_GET['do'])) {
$do = trim($_GET['do']);
if (isset($_GET['id'])) {
$id = intval($_GET['id']);
}
if ($do == "permission") {
$tpl_file = "membergroup.permission";
}
if ($do == "del" && !empty($id)) {
$membergroup->del($id);
}
if ($do == "edit") {
$data = array();
foreach ($_PB_CACHE['membergroup'] as $key1 => $val1) {
示例12: Messages
$message = new Messages();
$page = new Pages();
$conditions = array();
$tpl_file = "message";
if (isset($_POST['del']) && is_array($_POST['id'])) {
$deleted = $message->del($_POST['id']);
if (!$deleted) {
flash();
}
}
if (isset($_POST['save'])) {
$sended = $message->SendToUser($current_adminer, $_POST['to_username'], $_POST['data']['message']);
if (!$sended) {
flash(null, null, 0);
} else {
pheader("location:message.php");
}
}
if (isset($_GET['do'])) {
$do = trim($_GET['do']);
if (!empty($_GET['id'])) {
$id = intval($_GET['id']);
}
if ($do == 'search') {
if (!empty($_GET['q'])) {
$conditions[] = "title like '%" . trim($_GET['q']) . "%'";
}
}
if ($do == "send") {
$tpl_file = "message.send";
template($tpl_file);
示例13: time
$iteminfo['product_id'] = $pid;
$charginginfo = $payment->request($iteminfo);
if (isset($charginginfo)) {
$token = $charginginfo[0];
$redirectUrl = $charginginfo[1];
//Get Charging status
//Save token to order
$vals['transection_token'] = $token;
$vals['transection_time'] = time();
$vals['transection_method'] = 'wap-tinhvan';
$vals['msisdn'] = $_SESSION['msisdn'];
$vals['product_id'] = $pid;
$vals['device_id'] = $device_id;
$resul_s = $transection->save($vals);
if ($resul_s == 1 && $token != "" && $token != "-1" && $token != "-2") {
pheader("Location: " . $redirectUrl);
} else {
flash("Đăng ký giao dịch không thành công!");
}
}
} else {
//Neu giao dich mien phi
$token = pb_radom(24, 1);
$vals['transection_token'] = $token;
$vals['transection_time'] = time();
$vals['transection_method'] = 'free';
$vals['msisdn'] = $_SESSION['msisdn'];
$vals['product_id'] = $pid;
$vals['device_id'] = $device_id;
$vals['status'] = 1;
$resul_s = $transection->save($vals);
示例14: VALUE
if (!empty($id)) {
$result = $pdb->Execute("UPDATE {$tb_prefix}passports SET title='" . $datas['title'] . "',url='" . $datas['url'] . "',description='" . $datas['description'] . "',available='" . $datas['available'] . "',config='" . $datas['config'] . "',modified={$time_stamp} WHERE id=" . $id);
} else {
$result = $pdb->Execute("INSERT INTO {$tb_prefix}passports (name,title,description,url,available,config,created,modified) VALUE ('" . $datas['name'] . "','" . $datas['title'] . "','" . $datas['description'] . "','" . $datas['url'] . "','" . $datas['available'] . "','" . $datas['config'] . "',{$time_stamp},{$time_stamp});");
}
if ($datas['name'] == "ucenter") {
if (!$file->file_writeable($passport->passport_path . $datas['name'] . DS . "config.inc.php")) {
flash("file_not_writeable", null, 0);
} else {
$passport->writeConfig($datas['name'] . DS . "config.inc.php", $_POST['data']['config']);
}
}
if (!$result) {
flash("action_failed", null, 0);
} else {
pheader("Location:passport.php");
}
}
if (isset($_GET['do'])) {
$do = trim($_GET['do']);
if (!empty($_GET['id'])) {
$id = intval($_GET['id']);
}
if ($do == "set") {
$item = $pdb->GetRow("SELECT valued AS passport_support FROM {$tb_prefix}settings WHERE variable='passport_support'");
setvar("item", $item);
$tpl_file = "passport.set";
template($tpl_file);
exit;
}
if (!empty($_GET['entry'])) {
示例15: Companies
$company = new Companies();
$company_controller = new Company();
$smarty->template_dir = "template/";
$smarty->setCompileDir("office-room" . DS);
$smarty->flash_layout = "flash";
$check_invite_code = false;
$pdb->setFetchMode(ADODB_FETCH_ASSOC);
if (isset($_PB_CACHE['setting']['register_type'])) {
$register_type = $_PB_CACHE['setting']['register_type'];
if ($register_type == "open_invite_reg") {
setvar("IfInviteCode", true);
}
}
if (empty($_SESSION['MemberID']) || empty($_SESSION['MemberName'])) {
uclearcookies();
pheader("location:" . URL . "logging.php?forward=" . urlencode(pb_get_host() . $php_self));
}
//if caches
$cache_data = array();
if (isset($_PB_CACHE['setting']['member_cache']) && $_PB_CACHE['setting']['member_cache']) {
$pdb->Execute("DELETE FROM {$tb_prefix}membercaches WHERE expiration<" . $time_stamp);
$cache_data = $pdb->GetRow("SELECT data1 AS member,data2 AS company FROM {$tb_prefix}membercaches WHERE member_id='" . $_SESSION['MemberID'] . "'");
}
if (!empty($cache_data)) {
$memberinfo = @unserialize($cache_data['member']);
if (!empty($cache_data['company'])) {
$companyinfo = @unserialize($cache_data['company']);
$company_id = $companyinfo['id'];
setvar("COMPANYINFO", $companyinfo);
}
if (empty($memberinfo) || !is_array($memberinfo)) {