Illegal data processing for GET or post commit values _php
Source: Internet
Author: User
Keywords illegal filed str program STR_REPL
Illegal data processing for GET or post commit values
//********************************************************
--Program Name: Strswap V1.01
--Program writing: [Email]cngift@163.com[/email]
--Completion: 2002-8-1
--Program use: illegal data processing for GET or post commit values
--Note: This program needs to be loaded before all programs are processed so that it can be automatically
--substitution of variables used in the program
--Due to the discovery of a serious bug emergency upgrade
--Copyright by Cngift 2002
//********************************************************
Class strswap{
The connector used to concatenate variables when a variable is submitted in Get mode
var $GetSplitStr = "&&";
var $TempArray = array ();
var $VariableArray = array ();
//********************************************************
--Program Name: Main ()
--Program use: The default mode of operation for 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 that is called when a variable is submitted in Get mode
--Incoming parameters: None
//********************************************************
function Subgetstrtoarray () {
Global $QUERY _string;
$this->temparray = explode ($this->getsplitstr, $QUERY _string);
//********************************************************
--Program Name: Subpoststrtoarray ()
--Program Purpose: The method that is called when a variable is submitted as a post
--Incoming parameters: None
//********************************************************
function Subpoststrtoarray () {
Global $_post;
Reset ($_post);
for ($i =0; $i
$this->variablearray[$i][0] = key ($_post);
$this->variablearray[$i][1] = $this->strreplace ($_post[key ($_post)]);
Next ($_post);
}
}
//********************************************************
--Program Name: Strreplace ()
--Program Purpose: Replace illegal characters in variables
--Incoming parameter: variable value
//********************************************************
//********************************************************
--Program Name: GlobalVariable ()
--Program use: Declaring variables as global variables facilitates other program calls
--Incoming parameters: None
//********************************************************
function GlobalVariable () {
for ($i =0; $i Variablearray), $i + +) {
global $ $this->variablearray[$i][0];
${$this->variablearray[$i][0]} = $this->variablearray[$i][1];
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.