I need to post a hidden field in a form. The hidden field contains a session veriable. I have no clue why an extra " is put in there by itself. I can echo the session variable on the same page of the form w/o this problem.
"The session variable itself was coming off a TEXTAREA input and stored as session variable and at the end retrieved by the form for posting. "
PHP version: 4.3.2 on FreeBSD.
Register_Globals=on
Code: Select all
<?php
$ch=str_replace("\r\n","<br>",$_SESSIONїchallenge]);
echo $ch;
?>
<input type="hidden" name="ssl_challenge" value="<?php echo $ch;?>">RESULT from IE view | source:
------------------------------
<input TYPE="hidden" NAME="ssl_challenge" VALUE="Identify a current challenge—but state it as if it were ideally solved already.<br"><br>My challenge is to be a pizza man. How can I eat 5 boxes of 18 pizza without feeling like I am dying. That is a tough challenge.">
------------------------------
The result above shows the extra " in the first <br>. If I don't replace \r\n with <br>, then the whole text will get cut off.
Thanks in advance.
[/php_man]