From: [EMAIL PROTECTED]
Operating system: Windows 2000 Pro SP2
PHP version: 4.0.6
PHP Bug Type: Filesystem function related
Bug description: Adding newline \n in textarea output for each line
First the HTML source code :
<form action="test.php" METHOD=POST enctype="multiport/form-data">
<textarea name=text cols=20 rows=5>
One line.
Two line
Three line
</textarea>
<INPUT TYPE="submit" NAME="Submit" VALUE="Save"></CENTER>
</form>
Then test.php source code :
<?
$fichier = "test.txt";
$temp = fopen($fichier, "w");
fputs($temp,stripslashes($text));
fclose($temp);
print "Done !";
?>
When I open the test.txt the text isn't save like it would be.
Here the result :
One line.
Two line.
Three line.
It seems that a \n is added at each end of line of the textarea.
A friend try this code source with PHP 4.0.3pl1 and it works fine.
I have found a solution to have the file well saved using this line code
:
$goodtext = str_replace("\n", "", $text);
This is very strange and i can't affirm that it is a bug.
I have also try without enctype="" and with last CVS. this does nothing
better.
Have fun with this ;)
--
Edit bug report at: http://bugs.php.net/?id=13365&edit=1
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]