Home > php教程 > php手册 > php 有效安全过滤get,posd,cookie

php 有效安全过滤get,posd,cookie

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 09:54:37
Original
1056 people have browsed it

php 有效安全过滤get,posd,cookie

php 有效安全过滤get,posd,cookie
session_set_cookie_params(0, COOKIE_PATH, COOKIE_DOMAIN);

if($_REQUEST)
{
 if(MAGIC_QUOTES_GPC)
 {
  $_REQUEST = new_stripslashes($_REQUEST);
  if($_COOKIE) $_COOKIE = new_stripslashes($_COOKIE);
 }
 else
 {
  $_POST = new_addslashes($_POST);
  $_GET = new_addslashes($_GET);
  $_COOKIE = new_addslashes($_COOKIE);
  @extract($_POST);
  @extract($_GET);
  @extract($_COOKIE);
 }
 if(!defined('IN_ADMIN')) $_REQUEST = filter_xss($_REQUEST, ALLOWED_HTMLTAGS);
 extract($db->escape($_REQUEST), EXTR_SKIP);
 if($_COOKIE) $db->escape($_COOKIE);
}
if(QUERY_STRING && strpos(QUERY_STRING, '=') === false && preg_match("/^(.*).(htm|html|shtm|shtml)$/", QUERY_STRING, $urlvar))
{
 parse_str(str_replace(array('/', '-', ' '), array('&', '=', ''), $urlvar[1]));
}

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template