Re: urlencode and decode are producing \\\' instead of \'

From: Date: Fri, 29 Mar 2002 14:09:05 +0000
Subject: Re: urlencode and decode are producing \\\' instead of \'
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-90669@lists.php.net to get a copy of this message
Jason Wong wrote:
Well your problem is not caused by the rawurlencode, rawurldecode. It's probably because you have magic_quotes_gpc set to on. Try this: For your URL: rawurlencode(stripslashes($subject)), and same for $message. For your textarea: htmlspecialchars($subject), & $message. If you're putting $subject & $message into a DB you would probably want to do the reverse of htmlspecialchars() before inserting them into the DB.
Mr. Wong is wright :-) The only problem is that you should rawurlencode(stripslashes($subject)) in the header and htmlspecialchars(stripslashes($subject)) in the textarea for the expected results. Bogdan

« previous php.general (#90669) next »