|
Posted by J.O. Aho on 05/29/06 19:13
Ian Davies wrote:
> sorry I should have added, what if I want each newly added item to the
> session to display as seperat lines when returned to a text field?
$_SESSION['savedcomm'] = $_SESSION['savedcomm'] . "\n" . $_POST['selectcomm'];
This would add new line between the old and new data.
If you want to display it in a html section, then you can use nl2br()
http://www.php.net/manual/en/function.nl2br.php
<h2><?php echo nl2br($_SESSION['savedcomm']); ?></h2>
If you add things to a textarea, then do
<textarea name="thetext" rows="20" cols="80"><?php echo
$_SESSION['savedcomm']; ?></textarea>
Here you don't use the nl2br as the the textarea element does respect the new
line, which isn't done in html otherwise.
//Aho
Navigation:
[Reply to this message]
|