note 39491 added to function.urlencode
| From: | cameron at enprisesolutions dot com | Date: | Fri, 30 Jan 2004 10:52:10 +0000 |
| Subject: | note 39491 added to function.urlencode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-64427@lists.php.net to get a copy of this message | ||
>I have tried to make a redirection with urlencode(). If the url >contains "/"
>characters, they are replaced with "%2F" and >browser won't find the file. This
>is expected behavior, just a >warning to people.
here is my solution to urlencode slashes(/) in a redirection so the browser doesnt return an error.
function myurlencode ( $TheVal )
{
return urlencode (str_replace("/","{+}",$TheVal));
}
function myurldecode ( $TheVal )
{
return str_replace("{+}","/",urldecode ($TheVal));
}
----
Manual Page -- http://www.php.net/manual/en/function.urlencode.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39491
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39491&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39491&report=yes
Search -- http://master.php.net/manage/user-notes.php