Mathias 426 Report post Posted August 19, 2007 Note, all of my functions belong to classes, but I am posting only snippets of my functions to avoid boredom and giving away all my secrets. Please post corrections, suggestions, and your own related functions. Quote Understand this lad, fate is a fickle lady. Work with the hand you're dealt and you may just be able to run your flag up the pole. Don't, and well, you may just find your mast cut down. Share this post Link to post Share on other sites
Mathias 426 Report post Posted August 19, 2007 //----------------------------------------------------------------------- // Function: GetInput // Author: Andrew Hinkle // Modified: 08/18/2007 // Description: Return the merged $_GET and $_POST input. //----------------------------------------------------------------------- public function GetInput() { return array_merge((array)$_GET, (array)$_POST); } Quote Understand this lad, fate is a fickle lady. Work with the hand you're dealt and you may just be able to run your flag up the pole. Don't, and well, you may just find your mast cut down. Share this post Link to post Share on other sites
Mathias 426 Report post Posted August 19, 2007 //----------------------------------------------------------------------- // Function: CleanInput // Author: Andrew Hinkle // Modified: 08/18/2007 // Description: Return the cleaned array. //----------------------------------------------------------------------- public function CleanInput($aInput) { // Stripslashes if (is_array($aInput)) { foreach ($aInput as $sKey => $sValue) { // If magic quotes is on, it will automatically add backslashes. // Remove the extra slashes. $sValue = get_magic_quotes_gpc() ? stripslashes($sValue) $sValue; $aInput[$sKey] = !empty($sValue) && !is_null($sValue) ? trim($sValue) ""; } } else { // If magic quotes is on, it will automatically add backslashes. // Remove the extra slashes. $sValue = get_magic_quotes_gpc() ? stripslashes($aInput) $aInput; $aInput = !empty($sValue) && !is_null($sValue) ? trim($sValue) ""; } return $aInput; } Quote Understand this lad, fate is a fickle lady. Work with the hand you're dealt and you may just be able to run your flag up the pole. Don't, and well, you may just find your mast cut down. Share this post Link to post Share on other sites