[wp-hackers] Embedding forms in Wordpress

Russ Gilman-Hunt (YAR) gilmanhunt at comcast.net
Sun Nov 12 18:45:41 GMT 2006


On Sun, 12 Nov 2006 18:31:22 +0100
André Schieleit <wphackerslist at anschitech.de> wrote:

> > Just reference it as $_POST[$element]?
> Almost :).
> $_POST[element] would do the trick, thanks for this hint.
> But that would mean to change all occurrences of all $variables in  
> the file. So the variables keep their names and I have just three  
> lines additional code.
> 
>    André_______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers


I do this loop too, in some places. I think it's important to remember
that "register globals" defaults to "off" now for a reason; Now I
incorporate a case statement within the loop like:
for ( $_POST as $key=>$val ){
	switch ($key ){
		case "mine":
		case "mine":
		case "mine":
			${$key}=cleanup($val);
		break;
		default;	
	}
}
Where function "cleanup" is a function to clean user input.
-Russ

-- 
Russ Gilman-Hunt
http://www.arghwebworks.com/
gilmanhunt at comcast.net


More information about the wp-hackers mailing list