Forum Moderators: coopster

Message Too Old, No Replies

getting textarea content

         

web_server

4:48 pm on Mar 25, 2006 (gmt 0)



Hi ,
I have a simple form like this:

<form method=post action = page.php >
<textarea wrap=ON name=content/></textarea>
</form>

I want to get the content of the textarea field so I tried

$_POST['content'];

on page.php but it does not work . is this is wrong?
can you please give me the right solution?
thank you.

barns101

6:58 pm on Mar 25, 2006 (gmt 0)

10+ Year Member



That should work.

henry0

7:32 pm on Mar 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<TEXTAREA COLS=50 ROWS=1 NAME="content"
WRAP=VIRTUAL><?php print trim ($content);?></TEXTAREA>

On page.php you need to have
$content=$_POST['content'];

and to be sure that the "content" value passes OK
do for test purpose
$content=$_POST['content'];echo"content: $content";

web_server

8:08 pm on Mar 25, 2006 (gmt 0)



Thanks barns101 and henry0 . I figured out the problem.I put
<textarea wrap=ON name=content/></textarea>
and it works.

web_server

8:09 pm on Mar 25, 2006 (gmt 0)



I'm sorry I mean
<textarea wrap=ON value=content/></textarea>.

henry0

8:36 pm on Mar 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you do not trim the input you might end with extra white space at the beginning of your content
Plus anytime you will re-edit the same space will be kept and a new one will be added.
then you may try align="letf" but regardless the spaces will show and drive you crazy :)