note 66490 added to ref.array

From: Date: Wed, 24 May 2006 09:50:53 +0000
Subject: note 66490 added to ref.array
Groups: php.notes 
Request: Send a blank email to php-notes+get-111916@lists.php.net to get a copy of this message
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. ---- Server IP: 194.109.193.119 Probable Submitter: 145.85.44.54 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/ref.array.php Edit -- http://master.php.net/note/edit/66490 Del: integrated -- http://master.php.net/note/delete/66490/integrated Del: useless -- http://master.php.net/note/delete/66490/useless Del: bad code -- http://master.php.net/note/delete/66490/bad+code Del: spam -- http://master.php.net/note/delete/66490/spam Del: non-english -- http://master.php.net/note/delete/66490/non-english Del: in docs -- http://master.php.net/note/delete/66490/in+docs Del: other reasons-- http://master.php.net/note/delete/66490 Reject -- http://master.php.net/note/reject/66490 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#111916) next »