Invalid data processing for the value submitted by Get or Post
Source: Internet
Author: User
Illegal data processing for the value submitted by Get or Post? Php //************************************* * ****************** // -- program name: strSwapV1.01 // -- program: [email] cngift@163.com [/email] // -- done: 2002-8-1 // -- program
Invalid data processing for the value submitted by Get or Post
//************************************** ******************
// -- Program name: StrSwap V1.01
// -- Programming: [email] cngift@163.com [/email]
// -- Completed: 2002-8-1
// -- Program purpose: illegal data processing of the value submitted by Get or Post
// -- Note: This program needs to be loaded before all programs are processed for automatic
// -- Replace the variables used in the program
// -- Urgent upgrade due to detected serious bugs
// -- Copyright By cngift ◎ 2002
//************************************** ******************
Class StrSwap {
// The connector used to connect variables when you submit variables in Get mode
Var $ GetSplitStr = "&&";
Var $ TempArray = array ();
Var $ VariableArray = array ();
//************************************** ******************
// -- Program name: Main ()
// -- Program purpose: the default running mode of this class
// -- Input parameter: 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.
// -- Input parameter: None
//************************************** ******************
//************************************** ******************
// -- Program name: SubPostStrToArray ()
// -- Program purpose: the method called when the variable is submitted in POST mode.
// -- Input parameter: 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 invalid characters in the variable
// -- Input parameter: variable value
//************************************** ******************
//************************************** ******************
// -- Program name: GlobalVariable ()
// -- Program purpose: declare variables as global variables for other programs to call
// -- Input parameter: None
//************************************** ******************
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.