如果你的页面访问入口是这种类型:xxxx.php?cGFnZWlkPTEmtLS9qMjLPWFkbWluJmFjdGlvbj1pbml0X2RlZmF1bHQ=那么需要进行_GET变更的解析,下面是两个函数,一种是判断是否是BASE64加密函数,一种是对其进行解析的函数
xxxx.php?cGFnZWlkPTEmtLS9qMjLPWFkbWluJmFjdGlvbj1pbml0X2RlZmF1bHQ=这咱例子的生成是使用这样的写法:
xxxx.php?".base64_encode("ID=33&action=init")."
使用本函数,会得到ID和action的值
PHP代码
//判断GET变量是否为BASE64编码,不是很科学,需要进一步改进此函数 function isBase64() { global $_SERVER; $QUERY_STRING = $_SERVER['QUERY_STRING']; $Code = base64_decode($QUERY_STRING);//print base64_decode($Code); $Array = explode('=',$Code); if(sizeof($Array)>1) { return 1; } else return 0; } //重置_GET变量 function CheckBase64() { global $_GET,$_SERVER; $QUERY_STRING = $_SERVER['QUERY_STRING']; $QUERY_STRING_ARRAY = explode('&',$QUERY_STRING); $QUERY_STRING = $QUERY_STRING_ARRAY[0]; $QUERY_STRING = base64_decode($QUERY_STRING); $Array = explode('&',$QUERY_STRING); $_GET = array(); //形成新的_GET变量信息 $NewArray = array(); for($i=0;$i<sizeof($Array);$i++) { if($Array[$i]!="") { $ElementArray = explode('=',$Array[$i]); $_GET[(String)$ElementArray[0]] = $ElementArray[1]; $NewArray[$i] = $ElementArray[0]."=".$ElementArray[1]; } } //附加GET变量形成部分 for($i=1;$i<sizeof($QUERY_STRING_ARRAY);$i++) { if($QUERY_STRING_ARRAY[$i]!="") { $ElementArray = explode('=',$QUERY_STRING_ARRAY[$i]); $_GET[(String)$ElementArray[0]] = $ElementArray[1]; $NewArray[$i] = $ElementArray[0]."=".$ElementArray[1]; } } //形成新的_SERVER变量信息 $_SERVER['QUERY_STRING'] = join('&',$NewArray); $_SERVER['REQUEST_URI'] = $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']; }
Statement
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

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article
How to fix KB5055612 fails to install in Windows 10?
4 weeks agoByDDD
Roblox: Grow A Garden - Complete Mutation Guide
3 weeks agoByDDD
Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Dreamweaver Mac version
Visual web development tools

Atom editor mac version download
The most popular open source editor
