[PHP] urlencode and decode are producing \\\' instead of \'

2002-03-29 Thread andy

Hi there,

I am trying to fill a form again when an error occures, therefore I redirect
to the form and pass the values via url like this:

HEADER(Location:/profiles/6.$recipient_id.2.html?subject=.rawurlencode($
subject).message=.rawurlencode($message).);

then I put it in again like this
 textarea name=message rows=10 style=width:485px; cols=58
wrap=virtual'.rawurldecode($message).'/textarea

The problem is, that this is causing a message like this:
test  \\\'

So what's wrong? Can anybody help on this?

Thank you,

Andy



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] urlencode and decode are producing \\\' instead of \'

2002-03-29 Thread Bogdan Stancescu

You don't have to rawurlDEcode again - that's done automatically. You 
have to encode so you're HTTP compliant, but the decoding is done by PHP 
(or even Apache? I'm not sure) when receiving urlencoded strings via URL 
and form data.

Bogdan

andy wrote:

Hi there,

I am trying to fill a form again when an error occures, therefore I redirect
to the form and pass the values via url like this:

HEADER(Location:/profiles/6.$recipient_id.2.html?subject=.rawurlencode($
subject).message=.rawurlencode($message).);

then I put it in again like this
 textarea name=message rows=10 style=width:485px; cols=58
wrap=virtual'.rawurldecode($message).'/textarea

The problem is, that this is causing a message like this:
test  \\\'

So what's wrong? Can anybody help on this?

Thank you,

Andy







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] urlencode and decode are producing \\\' instead of \'

2002-03-29 Thread andy

does not help, any other ideas?


Bogdan Stancescu [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 You don't have to rawurlDEcode again - that's done automatically. You
 have to encode so you're HTTP compliant, but the decoding is done by PHP
 (or even Apache? I'm not sure) when receiving urlencoded strings via URL
 and form data.

 Bogdan

 andy wrote:

 Hi there,
 
 I am trying to fill a form again when an error occures, therefore I
redirect
 to the form and pass the values via url like this:
 

HEADER(Location:/profiles/6.$recipient_id.2.html?subject=.rawurlencode(
$
 subject).message=.rawurlencode($message).);
 
 then I put it in again like this
  textarea name=message rows=10 style=width:485px; cols=58
 wrap=virtual'.rawurldecode($message).'/textarea
 
 The problem is, that this is causing a message like this:
 test  \\\'
 
 So what's wrong? Can anybody help on this?
 
 Thank you,
 
 Andy
 
 
 






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] urlencode and decode are producing \\\' instead of \'

2002-03-29 Thread Andrey Hristov

try to do double rawurldecode().

Andrey

- Original Message - 
From: andy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 29, 2002 2:36 PM
Subject: Re: [PHP] urlencode and decode are producing \\\' instead of \'


 does not help, any other ideas?
 
 
 Bogdan Stancescu [EMAIL PROTECTED] schrieb im Newsbeitrag
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  You don't have to rawurlDEcode again - that's done automatically. You
  have to encode so you're HTTP compliant, but the decoding is done by PHP
  (or even Apache? I'm not sure) when receiving urlencoded strings via URL
  and form data.
 
  Bogdan
 
  andy wrote:
 
  Hi there,
  
  I am trying to fill a form again when an error occures, therefore I
 redirect
  to the form and pass the values via url like this:
  
 
 HEADER(Location:/profiles/6.$recipient_id.2.html?subject=.rawurlencode(
 $
  subject).message=.rawurlencode($message).);
  
  then I put it in again like this
   textarea name=message rows=10 style=width:485px; cols=58
  wrap=virtual'.rawurldecode($message).'/textarea
  
  The problem is, that this is causing a message like this:
  test  \\\'
  
  So what's wrong? Can anybody help on this?
  
  Thank you,
  
  Andy
  
  
  
 
 
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] urlencode and decode are producing \\\' instead of \'

2002-03-29 Thread andy

does not work. Just like the decode function is out of order!
It is not even decoding \'

Andy


Andrey Hristov [EMAIL PROTECTED] schrieb im Newsbeitrag
00e301c1d71e$b00569a0$0b01a8c0@ANDreY">news:00e301c1d71e$b00569a0$0b01a8c0@ANDreY...
 try to do double rawurldecode().

 Andrey

 - Original Message -
 From: andy [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, March 29, 2002 2:36 PM
 Subject: Re: [PHP] urlencode and decode are producing \\\' instead of \'


  does not help, any other ideas?
 
 
  Bogdan Stancescu [EMAIL PROTECTED] schrieb im Newsbeitrag
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   You don't have to rawurlDEcode again - that's done automatically. You
   have to encode so you're HTTP compliant, but the decoding is done by
PHP
   (or even Apache? I'm not sure) when receiving urlencoded strings via
URL
   and form data.
  
   Bogdan
  
   andy wrote:
  
   Hi there,
   
   I am trying to fill a form again when an error occures, therefore I
  redirect
   to the form and pass the values via url like this:
   
  
 
HEADER(Location:/profiles/6.$recipient_id.2.html?subject=.rawurlencode(
  $
   subject).message=.rawurlencode($message).);
   
   then I put it in again like this
textarea name=message rows=10 style=width:485px; cols=58
   wrap=virtual'.rawurldecode($message).'/textarea
   
   The problem is, that this is causing a message like this:
   test  \\\'
   
   So what's wrong? Can anybody help on this?
   
   Thank you,
   
   Andy
   
   
   
  
  
  
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] urlencode and decode are producing \\\' instead of \'

2002-03-29 Thread Jason Wong

On Friday 29 March 2002 20:56, andy wrote:
 does not work. Just like the decode function is out of order!
 It is not even decoding \'

I am trying to fill a form again when an error occures, therefore I
  
   redirect
  
to the form and pass the values via url like this:
 
 HEADER(Location:/profiles/6.$recipient_id.2.html?subject=.rawurlencode
 (
 
   $
  
subject).message=.rawurlencode($message).);

then I put it in again like this
 textarea name=message rows=10 style=width:485px; cols=58
wrap=virtual'.rawurldecode($message).'/textarea

The problem is, that this is causing a message like this:
test  \\\'

So what's wrong? Can anybody help on this?

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.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
If you don't know what game you're playing, don't ask what the score is.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] urlencode and decode are producing \\\' instead of \'

2002-03-29 Thread Bogdan Stancescu

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



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] urlencode and decode are producing \\\' instead of \'

2002-03-29 Thread Anders Henke

Hi!

What about using stripslashes:
$variable = stripslashes($variable);

Also see http://www.php.net/stripslashes

/Anders Henke


Jason Wong [EMAIL PROTECTED] skrev i meddelandet
news:[EMAIL PROTECTED]...
 On Friday 29 March 2002 20:56, andy wrote:
  does not work. Just like the decode function is out of order!
  It is not even decoding \'

 I am trying to fill a form again when an error occures, therefore
I
   
redirect
   
 to the form and pass the values via url like this:
  
 
HEADER(Location:/profiles/6.$recipient_id.2.html?subject=.rawurlencode
  (
  
$
   
 subject).message=.rawurlencode($message).);
 
 then I put it in again like this
  textarea name=message rows=10 style=width:485px;
cols=58
 wrap=virtual'.rawurldecode($message).'/textarea
 
 The problem is, that this is causing a message like this:
 test  \\\'
 
 So what's wrong? Can anybody help on this?

 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.

 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk

 /*
 If you don't know what game you're playing, don't ask what the score is.
 */




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php