本文整理汇总了PHP中safe_redirect函数的典型用法代码示例。如果您正苦于以下问题:PHP safe_redirect函数的具体用法?PHP safe_redirect怎么用?PHP safe_redirect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了safe_redirect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update_product_table
function update_product_table()
{
$action = $this->action;
if ($action == 'visibility') {
$this->update_product_table_visibility();
$type = 'success';
$msg = 'Changes successfully saved.';
} else {
if ($action == 'delete') {
$this->update_product_table_delete();
$type = 'success';
$msg = 'Item(s) successfully deleted.';
} else {
if ($action == 'new') {
$this->update_product_table_new();
} else {
if ($action == 'status') {
$this->update_product_active();
$type = 'success';
$msg = 'Changes successfully saved.';
}
}
}
}
$page = 'self';
set_alert($type, $msg);
safe_redirect($page);
}
示例2: edit
function edit()
{
//CI::library ( 'session' )->set_userdata ( 'editmode', false );
$is_admin = is_admin();
if ($is_admin == false) {
$go = site_url('login');
safe_redirect($go);
}
$layout = CI::view('admin/iframe', true, true);
$layout = CI::model('template')->parseMicrwoberTags($layout);
//$layout = CI::model('template')->parseMicrwoberTags ( $layout );
CI::library('output')->set_output($layout);
}
示例3: update_category
function update_category($name, $description, $visibility, $parent, $category_id)
{
if ($parent == 'top') {
$category_level = '0';
} else {
$sql = "SELECT * from tbl_category WHERE category_id = '{$parent}'";
$query = $this->conn->query($sql);
if ($query->num_rows != null) {
$get_level_array = $query->fetch_object();
$category_level = $get_level_array->category_level * 1 + 1;
}
}
$sql = "SELECT * FROM tbl_category ORDER BY category_order DESC";
$query = $this->conn->query($sql);
if ($query->num_rows != null) {
$get_order_array = $query->fetch_object();
$category_order = $get_order_array->category_order * 1 + 1;
}
$get_alias = $this->get_alias($parent);
if ($parent == 'top') {
$alias = cleanurl($name);
} else {
$alias = $get_alias->category_alias . '-' . cleanurl($name);
}
$count_alias = $this->count_alias($alias, $category_id);
if ($count_alias->rows > 0) {
$type = 'danger';
$msg = $name . ' has already existed';
safe_redirect('detail-category/' . $category_id . '/' . $name);
} else {
$alias = $alias;
}
$sql = "UPDATE tbl_category SET category_name = ?,\n\t \t\t\t\t\t\t\t\t\t category_alias = ?,\n category_level = ?,\n\t\t\t\t\t\t\t\t\t\t category_visibility_status = ?,\n\t\t\t\t\t\t\t\t\t\t category_description = ? \n WHERE category_id = ?\n\t\t\t ";
$stmt = $this->conn->prepare($sql);
if ($stmt === false) {
trigger_error('Database error: ' . $sql . ' Error: ' . $this->conn->errno . ' ' . $this->conn->error, E_USER_ERROR);
} else {
$stmt->bind_param("ssssss", $name, $alias, $category_level, $visibility, $description, $category_id);
$stmt->execute();
}
$stmt->close();
$this->update_category_relation($category_id, $parent);
}
示例4: safe_redirect
$payment = 'Confirmed';
$fulfillment = 'Unfulfilled';
$cancelled_date = '0000-00-00 00:00:00';
$order_closed_date = '0000-00-00 00:00:00';
$confirm_bank = 'Paypal';
$confirm_name = $success->order_billing_fullname;
//$confirm_amount = price(2, ($success->order_total_amount / $_global_general->currency_rate));
$confirm_amount = $success->order_total_amount;
$order_number = $success->order_number;
//$shipping_amount = price(2, ($success->order_shipping_amount / $_global_general->currency_rate));
$shipping_amount = $success->order_shipping_amount;
if ($_SESSION['paypal']['email'] != 'done') {
$_update->update_order_status($status, $payment, $fulfillment, $cancelled_date, $order_closed_date, $confirm_bank, $confirm_name, $confirm_amount, $order_number);
//$_update->update_order('USD', $shipping_amount, $order_number);
/* --- EMAIL: CHALLANGE --- */
safe_redirect('email-paypal-customer-pending/' . $order_number);
}
} else {
if ($code == 202) {
/* --- FAILED / ERROR / DENIED --- */
$ord_day = date("d");
$ord_month = date("m");
$ord_year = date("y");
$ord_hour = date('H');
$ord_min = date('i');
$ord_sec = date('s');
$ord_date = $ord_year . "-" . $ord_month . "-" . $ord_day . ' ' . $ord_hour . ':' . $ord_min . ':' . $ord_sec;
$status = 'Cancelled';
$payment = 'Unpaid';
$fulfillment = 'Unfulfilled';
$cancelled_date = $ord_date;
示例5: safe_redirect
$data['post_title'] = $_POST['contact_title'];
$data['post_content'] = $_POST['address_content'];
$data['post_type'] = 'tab';
$data['post_position'] = $_POST['tab_position'];
if (isset($_GET['id'])) {
if ($post->update_post($data, array('id' => $_GET['id']))) {
$session->message("Your tab update successful! ");
safe_redirect(admin_url('new-post') . '?post=tab&id=' . $_GET['id']);
} else {
var_dump($main_db->last_query);
exit;
}
} else {
if ($post->insert_posts($data)) {
$session->message("Your tab has been created!");
safe_redirect(admin_url('new-post') . '?post=tab&id=' . $main_db->insert_id);
} else {
var_dump($main_db->last_query);
exit;
}
}
}
$current_post = NULL;
if (isset($_GET['id'])) {
$current_post = $post->get_post_by_id($_GET['id']);
}
$allPosts = $post->get_post_by('address');
?>
<div class="row main-content special">
示例6: dirname
$temp_stock = $_get->get_product_stock($get_item->type_id, $get_item->stock_name);
$stock = $temp_stock->stock_quantity + $get_item->item_quantity;
$_update->order_update_stock($stock, $temp_stock->stock_id);
}
}
if(isset($_POST['cancel-option-notify']) && $_POST['cancel-option-notify'] == 'notify-cancel'){
//safe_redirect('email-order-details-cancelled/'.$order_number);
require dirname(__FILE__).'/../../emails/order_/_cancel/_cancel.php';
}else{
$type = 'success';
$msg = 'Changes successfully saved';
safe_redirect('self');
}
}
/*
# ----------------------------------------------------------------------
# ORDER - EDIT: CONTROL
# ----------------------------------------------------------------------
*/
if(isset($_POST['btn-edit-order'])){
/*
# ----------------------------------------------------------------------
示例7: safe_redirect
$_checkout_update->success_update_productsoldout($get_product_id->id);
}
}
/* --- UPDATE USER --- */
if ($_global_user->user_address == '') {
$_checkout_update->updateUser($order_ship_phone, $order_ship_address, $order_ship_country, $order_ship_province, $order_ship_city, $order_ship_postal, $_global_user->user_id);
}
/* --- MODULE --- */
if ($order_payment_method == '2') {
/* --- VERITRANS --- */
safe_redirect('control-veritrans/' . $order_number);
} else {
if ($order_payment_method == '4') {
/* --- PAYPAL --- */
safe_redirect('control-paypal/' . $order_number);
} else {
if ($order_payment_method != '2' && $order_payment_method != '4') {
/* --- EMAIL: CUSTOMER --- */
//safe_redirect('email-order-customer/'.$order_number);
/* --- ORDER LOG --- */
$description = 1;
$created_date = date('Y-m-d H:i:s');
$note = '';
$_global->update_log($get_order_id->latest_order_id, $description, $note, $created_date);
require dirname(__FILE__) . '/../../admin/emails/order_/customer_/order_placed.php';
require dirname(__FILE__) . '/../../admin/emails/order_/admin_/order_placed.php';
safe_redirect('finish');
}
}
}
}
示例8: insert_product
function insert_product()
{
//include("static/thumbnail.php");
/* --- DEFINED VARIABLE --- */
$date = date('Y-m-d H:i:s');
$date_only = date('d-m-y-H-i-s');
$product_category = filter_var($this->product_category, FILTER_SANITIZE_NUMBER_INT);
$product_name = filter_var($this->product_name, FILTER_SANITIZE_STRING);
$product_size_type_id = filter_var($this->size_type, FILTER_SANITIZE_NUMBER_INT);
$product_id = filter_var($this->product_id, FILTER_SANITIZE_NUMBER_INT);
$type_id = $this->type_id;
//array
$color_id = $this->color_id;
//array
$type_name = $this->type_name;
//array
$type_code = $this->type_code;
//array
$type_price = $this->type_price;
//array
$type_description = $this->type_description;
//array
$type_sizefit = $this->type_sizefit;
//array
$type_image = $this->color_image;
//double_array
$type_delete = $this->type_delete;
//array
$order = $this->order;
//double_array
$image_id = $this->image_id;
$image_delete = $this->image_delete;
$stock_quantity = $this->stock_quantity;
//double_array
$stock_name = $this->stock_name;
//double_array
$type_weight = $this->type_weight;
$page_title = filter_var($this->page_title, FILTER_SANITIZE_STRING);
$page_description = filter_var($this->page_description, FILTER_SANITIZE_STRING);
$page_keywords = filter_var($this->page_keywords, FILTER_SANITIZE_STRING);
$product_alias = cleanurl($this->product_name, FILTER_SANITIZE_STRING);
/* --- EDIT PRODUCT --- */
$this->update_product($product_category, $product_name, $product_size_type_id, $product_alias, $page_title, $page_description, $page_keywords, $product_id);
/* --- TYPE PRODUCT --- */
$i = 0;
$max_order = $this->get_max_type_order();
foreach ($type_name as $key => $type_name) {
$i = $key;
$i = $i + $max_order->maximum_order;
$temp_type_order = $this->get_type_data($this->type_id[$key]);
/* --- DELETE PRODUCTS --- */
if ($this->type_delete[$key] == '1') {
if ($this->type_id[$key] != '') {
$type_id_ = $this->type_id[$key];
$this->update_delete_product('1', $type_id_);
$this->delete_stocks($type_id);
}
} else {
$type_code = filter_var($this->type_code[$key], FILTER_SANITIZE_STRING);
$type_name = filter_var($type_name, FILTER_SANITIZE_STRING);
$type_alias = cleanurl($type_name);
$type_price = filter_var($this->type_price[$key], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
$type_description = $this->type_description[$key];
$type_sizefit = $this->type_sizefit[$key];
$type_information = $this->type_information[$key];
$color_id = filter_var($this->color_id[$key], FILTER_SANITIZE_NUMBER_INT);
$type_weight = filter_var($this->type_weight[$key], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
$product_id = filter_var($this->product_id, FILTER_SANITIZE_NUMBER_INT);
$type_id = filter_var($this->type_id[$key], FILTER_SANITIZE_NUMBER_INT);
/* --- ADD --- */
if ($type_id == '') {
$this->insert_type_id($type_code, $type_name, $type_price, $type_description, $type_sizefit, $type_information, $color_id, $type_weight, $product_id, $i, $page_title, $page_description, $type_alias);
} else {
$this->update_type_id($type_code, $type_name, $type_price, $type_description, $type_sizefit, $type_information, $color_id, $type_weight, $temp_type_order->type_order, $type_alias, $page_title, $page_description, $type_id);
}
if ($type_id == '') {
$temp = $this->get_max_type_id();
$type_id = $temp->max_type_id;
} else {
$type_id = $type_id;
}
/* --- END: ADD --- */
/* --- TYPE COLOR IMAGE--- */
$i = $key;
if ($this->color_image["tmp_name"][$i] != null) {
$file_type = substr($this->color_image["name"][$i], -4);
$file_name = substr($this->color_image["name"][$i], 0, -4);
$tmp_name = $this->color_image["tmp_name"][$i];
$name = cleanurl($type_name) . "_" . $date_only . "_" . substr(cleanurl($file_name), 0, 20) . '-' . $k . $file_type;
$error = $this->color_image["error"][$i];
if ($error == 0) {
move_uploaded_file($tmp_name, "../files/uploads/type_color_image/{$name}");
$img_src = "files/uploads/type_color_image/{$name}";
} else {
$type = 'error';
$msg = 'Error: ' . $error;
set_alert($type, $msg);
safe_redirect('self');
}
$this->insert_type_color($img_src, $type_id);
//.........这里部分代码省略.........
示例9: update_temp_stock
$result = $query->fetch_object();
return $result;
}
function update_temp_stock($qty, $stock_id)
{
$sql = "UPDATE tbl_product_stock SET `stock_quantity` = ? WHERE `stock_id` = ?";
$stmt = $this->conn->prepare($sql);
if ($stmt === false) {
trigger_error('Database error: ' . $sql . ' Error: ' . $conn->errno . ' ' . $conn->error, E_USER_ERROR);
} else {
$stmt->bind_param("ss", $qty, $stock_id);
$stmt->execute();
}
$stmt->close();
}
}
$_logout = new LOGOUT_CLEANER();
if (isset($_SESSION['cart_type_id']) && isset($_SESSION['cart_stock_id']) && isset($_SESSION['cart_qty'])) {
$_session_type = $_SESSION['cart_type_id'];
$_session_stock = $_SESSION['cart_stock_id'];
$_session_qty = $_SESSION['cart_qty'];
/* --- BAG HANDLER --- */
foreach ($_session_type as $key => $_session_type) {
$_stock_name = $_logout->get_stock_name($_session_stock[$key]);
$_stock = $_logout->get_product($_session_type, $_stock_name->stock_name);
$temp_stock = $_session_qty[$key] + $_stock_name->stock_quantity;
$_logout->update_temp_stock($temp_stock, $_session_stock[$key]);
}
}
safe_redirect('logout.php');
示例10: CATEGORY_GET
<?php
/*
# ----------------------------------------------------------------------
# VOUCHER - ADD: CONTROL
# ----------------------------------------------------------------------
*/
$_get = new CATEGORY_GET();
$_update = new CATEGORY_UPDATE();
if (isset($_POST['btn-add-voucher']) && $_POST['btn-add-voucher'] == 'Save Changes') {
$usability = filter_var($_POST['usability'], FILTER_SANITIZE_STRING);
$validity = filter_var($_POST['validity'], FILTER_SANITIZE_STRING);
$type = filter_var($_POST['type'], FILTER_SANITIZE_STRING);
$amount = filter_var($_POST['amount'], FILTER_SANITIZE_NUMBER_FLOAT);
$code = filter_var($_POST['code'], FILTER_SANITIZE_STRING);
$start = filter_var($_POST['date_from'], FILTER_SANITIZE_STRING);
$end = filter_var($_POST['date_to'], FILTER_SANITIZE_NUMBER_INT);
$status = filter_var($_POST['status'], FILTER_SANITIZE_NUMBER_INT);
$visibility = filter_var($_POST['visibility'], FILTER_SANITIZE_NUMBER_INT);
//minimum purchase
$min_purchase = filter_var($_POST['min_purchase'], FILTER_SANITIZE_NUMBER_FLOAT);
//$_update->insert($usability, $validity, $type, $amount, $code, $start, $end, $status, $visibility);
//minimum purchase
$_update->insert($usability, $validity, $type, $amount, $code, $start, $end, $status, $visibility, $min_purchase);
$type = 'success';
$msg = 'Voucher successfully saved';
set_alert($type, $msg);
safe_redirect('add-voucher');
}
示例11: str_ireplace
$url = str_ireplace($site, '', $url);
$segs = explode('/', $url);
$segs_clean = array();
foreach ($segs as $segment) {
$origsegment = $segment;
$segment = explode(':', $segment);
if ($segment[0] == 'ref') {
//return $segment [1];
} else {
$segs_clean[] = $origsegment;
}
}
$segs_clean = implode('/', $segs_clean);
$site = site_url($segs_clean);
// print $site;
safe_redirect('Location: ' . $site);
exit;
} else {
// Set back_to url into session. Reset this session component when redirect.
$back_to = CI::model('core')->getParamFromURL('back_to');
if ($back_to) {
// var_dump($back_to);
CI::library('session')->set_userdata('back_to', $back_to);
}
$url = getCurentURL();
$segs = explode('.', $url);
$segs = str_ireplace('http://', '', $segs);
$segs = str_ireplace('https://', '', $segs);
$segs = $segs[0];
$test_if_user_subdomain = addslashes($segs);
$subdomain_user = array();
示例12: CATEGORY_GET
<?php
/*
# ----------------------------------------------------------------------
# CATEGORY - ADD: CONTROL
# ----------------------------------------------------------------------
*/
$_get = new CATEGORY_GET();
$_update = new CATEGORY_UPDATE();
if (isset($_POST['btn-add-category']) && $_POST['btn-add-category'] == 'Save Changes') {
$name = filter_var($_POST['name'], FILTER_SANITIZE_STRING);
$description = filter_var($_POST['description'], FILTER_SANITIZE_STRING);
$active = filter_var($_POST['active_status'], FILTER_SANITIZE_STRING);
$visibility = filter_var($_POST['visibility'], FILTER_SANITIZE_STRING);
$parent = filter_var($_POST['parent'], FILTER_SANITIZE_STRING);
$_update->add_category($name, $description, $parent, $active, $visibility);
safe_redirect('add-category');
}
示例13: include
if(ACT != 'account_/login/login' && ACT != 'account_/register_/register' && ACT != 'account_/resetpassword_/reset' && ACT != 'pages_/_landing/landing'){
include("static/navbar-style-2.php");
}
}/* --- DOKU NOTIFY --- */
/*
* ----------------------------------------------------------------------
* DYNAMIC CONTENT
* ----------------------------------------------------------------------
*/
if(empty($_REQUEST['act'])){
/* --- HOMEPAGE --- */
//include('pages_/home/index.php');
safe_redirect('new-arrival/all/all');
}else{
include(str_replace ('http','',$_REQUEST['act']).".php");
}
/*
* ----------------------------------------------------------------------
* FOOTER
* ----------------------------------------------------------------------
*/
if(ACT != 'static/_doku/doku_notify'){
/* --- HIDDEN @ LOGIN & REGISTER PAGE--- */
if(ACT != 'account_/login/login' && ACT != 'account_/register_/register' && ACT != 'account_/resetpassword_/reset' && ACT != 'pages_/_landing/landing'){
示例14: mail
<?php
/*
* ----------------------------------------------------------------------
* EMAIL - WAITING FOR PAYMENT CUSTOMER: VIEW
* ----------------------------------------------------------------------
*/
include 'get.php';
include 'update.php';
include 'control.php';
$headers = '';
$name = $_global_general->website_title;
$email = $_global_notification->email_order;
$recipient = $_global_user->user_email;
$subject = '[' . $_global_general->website_title . '] ' . $order_number . ' Waiting for Payment';
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$headers .= "From: " . $_global_general->website_title . " <" . $_global_info->email . ">\r\n";
mail($recipient, $subject, $mail_body, $headers);
/* --- EMAIL: ADMIN --- */
safe_redirect('email-veritrans-admin-challange/' . $order_number);
示例15: exit_redirect
function exit_redirect()
{
global $auto_restrict;
@session_unset();
@session_destroy();
delete_cookie();
if ($auto_restrict['redirect_error'] && $auto_restrict['redirect_error'] != '') {
safe_redirect($auto_restrict['redirect_error']);
} else {
exit($auto_restrict['error_msg']);
}
}