note 66490 deleted from ref.array by bjori

From: Date: Sat, 03 Jun 2006 11:08:24 +0000
Subject: note 66490 deleted from ref.array by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-113089@lists.php.net to get a copy of this message
Note Submitter: spongebob3 at hotmail dot com ---- Thank you, and I'm sorry for not knowing that. But still: the function may come at hand for converting POST-variables to GET-variables and redirecting to a page, with the POST-variables set and shown into the URL. The new function: <? function giveHeader() { $header = "http://".$_SERVER['HTTP_HOST']."/?"; for ($i=0; $i<count($_POST); $i++) { if ($_POST[key($_POST)]!=null) $header .= key($_POST)."=".$_GET[key($_POST)]."&"; else $header .= key($_POST)."&"; next($_POST); } $header = substr($header,0,strlen($header)-1); define(location,$header,true); } ?> The function can be called this way by using giveHeader(). The header variable will then be saved into the defined variable "location". Easy redirection can be done by using <? Header("Location:".location); ?> For further explanations for the function, look below.

« previous php.notes (#113089) next »