|
Posted by Ian Davies on 05/29/06 21:38
Thanks J.O.
That was what I wanted
"J.O. Aho" <user@example.net> wrote in message
news:4e0ksjF1cie9vU1@individual.net...
> 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]
|