note 80947 added to function.urlencode
| From: | randallgirard at hotmail dot com | Date: | Fri, 08 Feb 2008 00:49:50 +0000 |
| Subject: | note 80947 added to function.urlencode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-135888@lists.php.net to get a copy of this message | ||
As a reply to: mmj48.com
Your method of replacing just the slash would be BAD practice... UNLESS, it was used STRICTLY on the
PATH part of the URL.
You must account for the URLQUERIES, but also the scheme, user, password, and fragment characters
(:, /, &, #, etc)
However, these may change depending on the environment (mainly refering to the &, query var
separator)
Escaping each of these would also be a bad practice, and impractical. Rather, build a class / tool
which will generate your URL's, and render escapes. You could also use the PHP routine:
parse_url() for some interesting results.
----
Server IP: 64.71.164.2
Probable Submitter: 71.110.79.93
----
Manual Page -- http://www.php.net/manual/en/function.urlencode.php
Edit -- https://master.php.net/note/edit/80947
Del: integrated -- https://master.php.net/note/delete/80947/integrated
Del: useless -- https://master.php.net/note/delete/80947/useless
Del: bad code -- https://master.php.net/note/delete/80947/bad+code
Del: spam -- https://master.php.net/note/delete/80947/spam
Del: non-english -- https://master.php.net/note/delete/80947/non-english
Del: in docs -- https://master.php.net/note/delete/80947/in+docs
Del: other reasons-- https://master.php.net/note/delete/80947
Reject -- https://master.php.net/note/reject/80947
Search -- https://master.php.net/manage/user-notes.php