note 58326 added to function.urlencode
| From: | Chris at osu1 dot php dot net | Date: | Mon, 31 Oct 2005 16:54:16 +0000 |
| Subject: | note 58326 added to function.urlencode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-97885@lists.php.net to get a copy of this message | ||
Just remember that according to W3C standards, you must rawurlencode() the link that's provided
at the end of a mailto.
i.e.
<a href="mailto:jdoe@some.where.com?Subject=Simple
testing(s)&bcc=jane@some.where.com">Mail Me</a>
Needs to be escaped (which rawurlencode() does for us).
The colon is OK after "mailto", as is the "@" after the e-mail name.
However, the rest of the URL needs to be encoded, replacing the following:
'?' => %3F
'=' => %3D
' ' => %20
'(' => %28
')' => %29
'&' => %26
'@' => %40 (note this one is in 'jane@some.where.com'
I tried to post the note with the correct text (that is the characters replaced in the note), but it
said that there was a line that was too long, and so wouldn't let me add the note.
As a secondary note, I noticed that the auto-conversion routines at this site itself stopped the
link at the space after "Simple testing(s)' in the first entry shown above.
----
Manual Page -- http://www.php.net/manual/en/function.urlencode.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+58326
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58326&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58326&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58326&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58326&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58326&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58326&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58326&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+58326&report=yes
Search -- http://master.php.net/manage/user-notes.php