note 85223 added to function.rawurlencode

From: Date: Thu, 21 Aug 2008 07:45:39 +0000
Subject: note 85223 added to function.rawurlencode
Groups: php.notes 
Request: Send a blank email to php-notes+get-143697@lists.php.net to get a copy of this message
You cannot use urlencode or rawurlencode within header(Location:/Refresh) They convert the forward slashes and colon and hence header() does not take you to the other site but tries to search the url on your own site e.g $url="http://www.haroonahmad.co.uk?index.php?feed=xxx&aff=zzz" header("Refresh:1; URL='".urlencode($url)."'") say if you run this on www.example.com it will redirect to www.example.com/ http%3A%2F%2Fwww.haroonahmad.co.uk %3Findex.php%3Ffeed%3Dxxx%26aff%3Dzzz (i have broken the above single long line into multiple lines for the comfort of posting on this manual) and hence showing the 404 not found error. You got to encode the query string variables separately and send in the url and not the full url itself. ---- Server IP: 69.147.83.197 Probable Submitter: 116.71.211.85 ---- Manual Page -- http://www.php.net/manual/en/function.rawurlencode.php Edit -- https://master.php.net/note/edit/85223 Del: integrated -- https://master.php.net/note/delete/85223/integrated Del: useless -- https://master.php.net/note/delete/85223/useless Del: bad code -- https://master.php.net/note/delete/85223/bad+code Del: spam -- https://master.php.net/note/delete/85223/spam Del: non-english -- https://master.php.net/note/delete/85223/non-english Del: in docs -- https://master.php.net/note/delete/85223/in+docs Del: other reasons-- https://master.php.net/note/delete/85223 Reject -- https://master.php.net/note/reject/85223 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#143697) next »