note 77469 added to function.parse-str

From: Date: Thu, 30 Aug 2007 19:51:39 +0000
Subject: note 77469 added to function.parse-str
Groups: php.notes 
Request: Send a blank email to php-notes+get-129916@lists.php.net to get a copy of this message
I saw some posts with people wondering why &'s are being sent to this function. Well, basically because thats what comes from a QUERY_STRING. Anyway. The bug i found is that the first part of a query_string may not contain an &. Usually the first parameter comes directly after the ?. So you might have to manually pre-pend an & to your query_string if one does not exist. <?php $base="www.yahoo.com/search.aspx?"; $parsedurl=parse_url($base."&".rawurldecode($_SERVER ['QUERY_STRING']), PHP_URL_QUERY); parse_str($parsedurl,$myquery); $qbn = "n=".urlencode($myquery['n']); ?> oh my god! to get this to post is ridiculous. ---- Server IP: 64.71.164.2 Probable Submitter: 67.80.103.30 ---- Manual Page -- http://www.php.net/manual/en/function.parse-str.php Edit -- https://master.php.net/note/edit/77469 Del: integrated -- https://master.php.net/note/delete/77469/integrated Del: useless -- https://master.php.net/note/delete/77469/useless Del: bad code -- https://master.php.net/note/delete/77469/bad+code Del: spam -- https://master.php.net/note/delete/77469/spam Del: non-english -- https://master.php.net/note/delete/77469/non-english Del: in docs -- https://master.php.net/note/delete/77469/in+docs Del: other reasons-- https://master.php.net/note/delete/77469 Reject -- https://master.php.net/note/reject/77469 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#129916) next »