RE: Passing +, =, - at post and get

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sorry, don't have time to go through your code or to look up the regex
way of doing this, but you can translate then decode the plus sign
fairly easily.  One really basic example:

$plussign = "+";
echo "Plus: $plussign\n";
$plussign = "&#" . ord($plussign) .";";
echo "HTML Entity Plus: $plussign\n";
$plussign = chr(substr($plussign,2,strlen($plussign)-3));
echo "HTML Entity Converted Back: $plussign\n";


The plus sign should pass through a POST ok, but in a GET the plus sign
is used to represent spaces in a URL sometimes.  Ampersands, equal
signs, forward (and probably back) slashes, colons and question marks
are also used in URLs (might have forgot some).  Since GET puts all the
data through a URL, you need to be aware of the reserved characters used
in URLs.  You shouldn't have this problem through a POST transaction
though.  I'm not aware of anything that won't pass through POST, but I'm
sure there's something.

There's almost always a way to transfer text into something that'll pass
through POST or GET without screwing things up.  Easier to change the
code than change the users.

-TG

> -----Original Message-----
> From: George Pitcher [mailto:george.pitcher@xxxxxxxxxxx] 
> Sent: Thursday, May 20, 2004 9:43 AM
> To: php-windows@xxxxxxxxxxxxx
> Subject: RE:  Passing +, =, - at post and get
> 
> 
> And doing a bit more, I find that '=' and '-' are passing 
> through OK so I'll
> need to train my users to use an alternative to '+'.

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



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux