note 82281 added to function.urldecode
| From: | Joe at osu1 dot php dot net | Date: | Thu, 03 Apr 2008 19:11:33 +0000 |
| Subject: | note 82281 added to function.urldecode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-137908@lists.php.net to get a copy of this message | ||
It's worth pointing out that if you are using AJAX and need to encode strings that are being
sent to a PHP application, you may not need to decode them in PHP.
<?php
echo stripslashes(nl2br($_POST['message']));
?>
Will properly output a message sent with the javascript code if the message is encoded:
message = encodeURIComponent(message)
And is sent with an AJAX POST request with the header:
ajaxVar.setRequestHeader('Content-type', 'application/x-www-form-urlencoded')
----
Server IP: 64.71.164.2
Probable Submitter: 137.123.62.200
----
Manual Page -- http://www.php.net/manual/en/function.urldecode.php
Edit -- https://master.php.net/note/edit/82281
Del: integrated -- https://master.php.net/note/delete/82281/integrated
Del: useless -- https://master.php.net/note/delete/82281/useless
Del: bad code -- https://master.php.net/note/delete/82281/bad+code
Del: spam -- https://master.php.net/note/delete/82281/spam
Del: non-english -- https://master.php.net/note/delete/82281/non-english
Del: in docs -- https://master.php.net/note/delete/82281/in+docs
Del: other reasons-- https://master.php.net/note/delete/82281
Reject -- https://master.php.net/note/reject/82281
Search -- https://master.php.net/manage/user-notes.php