Page 1 of 1

How do I pass + via POST?

Posted: Thu Mar 01, 2007 12:39 pm
by nadavvin
It disappear in $_POST.

I try to use Javascript escape and parse it with html_entity_decode and still "+" disappear.

How do I pass it?

Posted: Thu Mar 01, 2007 2:12 pm
by Christopher
The plus sign is '%2B', I found this code by googling your question for you:

Code: Select all

function URLencode(sStr) {
    return escape(sStr)
       .replace(/\+/g, '%2B')
          .replace(/\"/g,'%22')
             .replace(/\'/g, '%27');
  }

Posted: Thu Mar 01, 2007 2:20 pm
by nadavvin
thanks.

and sorry for not googling.