Home >Backend Development >PHP Tutorial >Illegal character replacement program_PHP tutorial

Illegal character replacement program_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:09:05795browse


//************************************************ **********
//-- Program name: StrSwap V1.0
//-- Program purpose: Illegal data processing of Get or Post submitted values ​​
//-- Remarks: This program needs to be loaded and used before all program processing, so that it can be automatically performed
//-- Replacement of variables used in the program
//************************************************ **********

class StrSwap{

//The connector used to connect variables when submitting variables in Get mode
var $GetSplitStr = "&&";
var $TempArray = array();
var $VariableArray = array();

//************************************************ **********
//-- Program name: Main()
//-- Program purpose: the default running mode of this class
//-- Incoming parameters: None
//************************************************ **********

function Main(){

global $REQUEST_METHOD;
if("GET"==$REQUEST_METHOD){

$this->SubGetStrToArray();

}
if("POST"==$REQUEST_METHOD){

$this->SubPostStrToArray();

}

$this->GlobalVariable();



}

//************************************************ **********
//-- Program name: SubGetStrToArray()
//-- Program purpose: The method called when the variable is submitted in Get mode
//-- Incoming parameters: None
//************************************************ **********

function SubGetStrToArray(){

global $QUERY_STRING;
$this->TempArray = explode($this->GetSplitStr,$QUERY_STRING);

for($i=0;$iTempArray);$i ){

$temp = explode('=',$this->TempArray[$i]);
$this->VariableArray[$i][0] = $temp[0];
$this->VariableArray[$i][1] = $this->StrReplace($temp[1]);

}

}

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/629776.htmlTechArticle?php //******************** ************************************ //-- Program name: StrSwap V1.0 //- - Program purpose: illegal data processing of Get or Post submitted values ​​//-- Remarks: This program...
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