note 26989 deleted from security.registerglobals by philip

From: Date: Mon, 02 Dec 2002 20:17:49 +0000
Subject: note 26989 deleted from security.registerglobals by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-40274@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

« previous php.notes (#40274) next »