In addition to the GET and POST methods for processing web forms, the PHP program also reads the GET and POST methods for processing web forms, sometimes we need to keep the GET and POST parameters transmitted on the next page or for other purposes! At work, I wrote such code! Hope you can communicate more !? /* Program Design: Lin Jianxuan (floating maple design room) madein "> <LINKhref =" http
Sometimes we need to keep the GET and POST parameters transmitted on the next page or for other purposes!
At work, I wrote such code!
I hope you will have more exchanges!
/*
Program Design: Lin Jianxuan (floating maple design room)
Made in Zhuhai by 2007-03-24
QQ: 5818500
Email: linzhenxuan@163.com
Do not delete this copyright information
Purpose: retain and modify the GET and POST parameters.
*/
Function getplus ($ x = '', $ value ='', $ plus = 'close', $ method = 'all '){
Global $ _ GET, $ _ POST;
$ Array = array ();
If ($ method = 'all '){
$ Array [] =$ _ GET; $ array [] =$ _ POST ;}
Elseif ($ method = 'get') {$ array [] = $ _ get ;}
Elseif ($ method = 'post') {$ array [] = $ _ post ;}
$ A = $ _ GET;
$ I = 1;
$ True = 0;
Foreach ($ array as $ k => $ ){
Foreach ($ a as $ B => $ c ){
If ($ B = $ x ){
$ C = $ value;
$ True = 1; // found
$ True2 = 1;
}
If ($ plus = 'close '){
If ($ I = 1 ){
$ Temp. = "? $ B = $ c ";
} Else {
$ Temp. = "& $ B = $ c ";
}
} Else {
If ($ I = 1 ){
If ($ true2! = 1) {$ temp. = "? $ B = $ c ";} else {$ temp. = "? "; Unset ($ true2 );}
} Else {
If ($ true2! = 1) {$ temp. = "& $ B = $ c";} else {unset ($ true2 );}
}
}
$ I ++;
}
}
If ($ true = 0 ){
If (strpos ($ temp ,"? ")> 0 | strpos ($ temp," = ")> 0 ){
$ Temp. = "& $ x = $ value ";
} Else {
$ Temp. = "? $ X = $ value ";
}
}
Elseif ($ true = 1 & $ plus! = 'Close '){
If (strpos ($ temp ,"? ")> 0 | strpos ($ temp," = ")> 0 ){
$ Temp. = "& $ x = $ value ";
} Else {
$ Temp. = "? $ X = $ value ";
}
}
Return $ temp;
}
?>
For example
GET :? Method = 1 & a = 1 & B = 2
POST: y = 2007 & m = 03
Used
Shown later
? Method = 1 & a = 1 & B = 2 & y = 2007 & m = 03 & c = 3
Used
Shown later
? Method = 1 & B = 2 & y = 2007 & m = 03 & a = 3
Drag a = 3 to the end
I use Integration with javascript
Previous Page
I feel pretty good!
There may be bugs not found!
I hope you can mention it more!