POST/GET into variables
| From: | nihilism machine | Date: | Mon, 21 Jan 2008 02:47:01 +0000 |
| Subject: | POST/GET into variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-267734@lists.php.net to get a copy of this message | ||
how does this look? should this by me calling ... myforms = new forms(); work by turning all key/value pairs for both get and post into variable names of the same name as the get/post key, and the variable values as the values from the post/get?
class forms {
// Some stuff
var $MyPosts;
var $MyGets;
var $CleanedInput;
// Connect to the databasefunction forms() { foreach($_POST as $curPostKey => $curPostVal) { CleanInput($curPostKey); $$curPostKey = $curPostVal; } foreach($_GET as $curGetKey => $curGetVal) { CleanInput($curGetKey); $$curGetKey = $curGetVal; } }
// Attempt to login a userfunction CleanInput($userInput) { return $this->CleanedInput; } } thanks to anyone in advance