本文整理汇总了PHP中xsrf_guard函数的典型用法代码示例。如果您正苦于以下问题:PHP xsrf_guard函数的具体用法?PHP xsrf_guard怎么用?PHP xsrf_guard使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xsrf_guard函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init_cobalt
<?php
//******************************************************************
//This file was generated by Cobalt, a rapid application development
//framework developed by JV Roig (jvroig@jvroig.com).
//
//Cobalt on the web: http://cobalt.jvroig.com
//******************************************************************
require 'path.php';
init_cobalt('Add user links');
if (isset($_GET['filter_field_used']) && isset($_GET['filter_used']) && isset($_GET['page_from'])) {
require 'components/get_listview_referrer.php';
}
if (xsrf_guard()) {
init_var($_POST['btn_cancel']);
init_var($_POST['btn_submit']);
require 'components/query_string_standard.php';
require 'subclasses/user_links.php';
$dbh_user_links = new user_links();
$object_name = 'dbh_user_links';
require 'components/create_form_data.php';
extract($arr_form_data);
if ($_POST['btn_cancel']) {
log_action('Pressed cancel button');
redirect("listview_user_links.php?{$query_string}");
}
if ($_POST['btn_submit']) {
log_action('Pressed submit button');
$message .= $dbh_user_links->sanitize($arr_form_data)->lst_error;
extract($arr_form_data);
if ($dbh_user_links->check_uniqueness($arr_form_data)->is_unique) {
示例2: init_cobalt
<?php
//******************************************************************
//This file was generated by Cobalt, a rapid application development
//framework developed by JV Roig (jvroig@jvroig.com).
//
//Cobalt on the web: http://cobalt.jvroig.com
//******************************************************************
require 'path.php';
init_cobalt('Delete refstudent');
if (isset($_GET['student_id'])) {
$student_id = urldecode($_GET['student_id']);
require_once 'form_data_refstudent.php';
} elseif (xsrf_guard()) {
init_var($_POST['btn_cancel']);
init_var($_POST['btn_delete']);
require 'components/query_string_standard.php';
if ($_POST['btn_cancel']) {
log_action('Pressed cancel button', $_SERVER['PHP_SELF']);
redirect("listview_refstudent.php?{$query_string}");
} elseif ($_POST['btn_delete']) {
log_action('Pressed delete button', $_SERVER['PHP_SELF']);
require_once 'subclasses/refstudent.php';
$dbh_refstudent = new refstudent();
$object_name = 'dbh_refstudent';
require 'components/create_form_data.php';
$dbh_refstudent->del($arr_form_data);
redirect("listview_refstudent.php?{$query_string}");
}
}
require 'subclasses/refstudent_html.php';