note 26989 added to security.registerglobals

From: Date: Tue, 19 Nov 2002 19:18:29 +0000
Subject: note 26989 added to security.registerglobals
Groups: php.notes 
Request: Send a blank email to php-notes+get-39710@lists.php.net to get a copy of this message
Yet another way of doing the same thing A long time ago I created a stdlib.php that only had a redirect routine. Since I have stdlib everywhere I do not need to do much work now. Anyway stdlib.php just contains this class PHPPage{ function import($name,$type){ foreach ( split(":", $type) as $t){ if ($t == "GET" && array_key_exists($name, $_GET)) return $_GET[$name]; else if ($t == "POST" && array_key_exists($name,$_POST)) return $_POST[$name]; else if ($t == "COOKIE" && array_key_exists($name,$_COOKIE)) return $_COOKIE[$name]; } return ""; } function redirect($url, $message="", $delay=0){ echo "<meta http-equiv='Refresh' content='$delay; url=$url'>"; if (!empty($message)) echo "<div style='font-family: Arial, Sans-serif; font-size: 12pt;' align=center>$message</div>"; die; } } now in my code I do $tenantID = PHPPage::import("tenantID","POST:GET"); I like this approach since depending on what I am doing I will send a variable by post or/and get. Hope this helps someone -- http://www.php.net/manual/en/security.registerglobals.php http://master.php.net/manage/user-notes.php?action=edit+26989 http://master.php.net/manage/user-notes.php?action=delete+26989 http://master.php.net/manage/user-notes.php?action=reject+26989

« previous php.notes (#39710) next »