Results 1 to 4 of 4

Thread: php $_POST problem with text spaces

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    php $_POST problem with text spaces

    what im doing is posting the message from the previous page when the save button is clicked, and putting this message in the textbox..

    PHP Code:
                    if (isset($_POST['Save'])) {
                        
                        $text = $_POST['textarea'];
                        
                        ?> <textarea align="center" name="textarea" cols="70" rows="13">
                            <? echo $text; ?>
                        </textarea>
    .. blah blah
    but the text appears indented in the textbox, any idea why?

  2. #2
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    Re: php $_POST problem with text spaces

    instread of
    PHP Code:
                        <textarea align="center" name="textarea" cols="70" rows="13">
                            <? echo $text; ?>
                        </textarea>
    try
    PHP Code:
                        <textarea align="center" name="textarea" cols="70" rows="13"><? echo $text; ?></textarea>
    Because you have indented your HTML (which is good) you have added in the space on the intentation to the text of the textarea.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: php $_POST problem with text spaces

    ahh, i didnt know that had an effect, thanks alot!!

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: php $_POST problem with text spaces

    Textareas are set to white-space: pre unlike other elements which by default discard excess whitespace.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width