add in "nl2br2" to a new line
| From: | Joker7 | Date: | Tue, 08 Jul 2008 13:41:53 +0000 |
| Subject: | add in "nl2br2" to a new line | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-2046@lists.php.net to get a copy of this message | ||
Hi,
Im having a bit of trouble working out how to add a line break to new
lines.I have read http://uk.php.net/nl2br to I almost know it
of by heart!
Here's the code Im trying to add it to,any help here would be most welcome.
Chris
<form action="update.php" method="post">
<textarea rows="25" cols="40" name="content">
<?
$fn = "test.txt";
print htmlspecialchars(implode("",file($fn)));
?>
</textarea><br />
<input type="submit" value="Change!">
</form>
<Update php>
<?
$fn = "test.txt";
$content = stripslashes($_POST['content']);
$fp = fopen($fn,"w") or die ("Error opening file!!");
fputs($fp,$content);
fclose($fp) or die ("Error closing file!");
echo "<meta http-equiv=\"refresh\" content=\"0; url=index.php\"
/>\n";
?>