[PHP] Re: Plus sign changing to space in html form

2002-10-31 Thread Phoebe Bright
Here is a fudge that uses Javascript to convert the + into {PLUS} then 
PHP converts it back again.  The only problem is Javascript is only 
converting the first +, so a+b+c becomes a+b c.



$testVal=str_replace("{PLUS}","+",$_POST['test']);
echo $testVal;
php?>

function SaveHiddenChars() {
document.form1.test.value=document.form1.test.value.replace("+","{PLUS}");
}
Stan wrote: When i post a string containing plus sign with htmp form to a php scritp, the '+' is changed to space. e.g: i enter 'as+df' to a text input but $_POST[] returns 'as df' instead. It must be in php or apache configuration bcause i have this problem only on sytem with FreeBSD. On windows it works as expected. Know someone how could i make the '+' left intact? Please help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Plus sign changing to space in html form

2002-10-31 Thread Phoebe Bright
I am battling with the same problem on both IE and Netscape on Mac OS 
10.2.  Is this a Mac thing?

I ammended your code in the hope that something was being passed that 
only looked like a space..


echo $_POST['test'].'';
 for($n=1;$n<=strlen($_POST['test']);$n++) {
	echo var_dump(hexdec(substr($_POST['test'],$n-1,1)));
}
php?>






If I enter a+b it returns:
a b
int(10) int(0) int(11)

I can't ask users to enter ab or some such code, there must be a 
solution.   I don't belive this is going to defeat the collective brains 
of the PHP list!

Phoebe.

Stan wrote:
When i post a string containing plus sign with htmp form to a php scritp,
the '+' is changed to space.
e.g: i enter 'as+df' to a text input but $_POST[] returns 'as df' instead.
It must be in php or apache configuration bcause i have this problem only on
sytem with FreeBSD. On windows it works as expected.

Know someone how could i make the '+' left intact? Please help.












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