Professional Web Applications Themes

where is the error please - PHP Development

hello when i type it in my texterea hello how are you I have it when I click in button ok hello how are you Please could you tell me why ? i dont have the skip line ;) thank you for your help This is the code <form name="form1" action="apercu.php"> <textarea name="com" rows="9" cols="59"></textarea> <input type="submit" name="ok" Value="ok"> </form> in aperçu.php I have it print($com);...

  1. #1

    Default where is the error please

    hello when i type it in my texterea

    hello
    how
    are
    you

    I have it when I click in button ok
    hello how are you

    Please could you tell me why ? i dont have the skip line ;) thank you for
    your help

    This is the code

    <form name="form1" action="apercu.php">
    <textarea name="com" rows="9" cols="59"></textarea>
    <input type="submit" name="ok" Value="ok">
    </form>


    in aperçu.php I have it

    print($com);







    Dave Guest

  2. #2

    Default Re: where is the error please

    Dave wrote: 
    Its because in HTML new lines are represented by <br/> not by a normal CRLF or similar.
    Look at your created HTML source. The new lines are there but not shown in the browser.
    Just use print(nl2br($com)); to get what you want.

    Regards
    Stefan
    Stefan Guest

  3. #3

    Default Re: where is the error please

    "Stefan Rybacki" <net> wrote in message
    news:net... 
    > Its because in HTML new lines are represented by <br/> not by a normal
    > CRLF or similar. Look at your created HTML source. The new lines are there
    > but not shown in the browser. Just use print(nl2br($com)); to get what you
    > want.
    >[/ref]


    I'd also like to remind that it would be great if register_globals was
    turned off and OP would use $_GET['com'] instead of $com, because that's
    bettercoding practise. Read more at: http://fi2.php.net/register_globals

    --
    Welcome to Usenet! Please leave tolerance, understanding
    and intelligence at the door. They aren't welcome here.
    eternal piste erection miuku gmail piste com


    Kimmo Guest

  4. #4

    Default Re: where is the error please

    "Dave" <us> pipotte et a dit :
     

    Dave, when the HTML is interpreted by your browser, NewLines are not
    printed on screen, to obtain your expected result, you have to use :

    print(nl2br($_REQUEST['com']));

    (Please not that I user $_REQUEST['com'] instead of $com, consider
    reading http://www.php.net/register_globals

    --
    Julien CROUZET aka c2c from Paris, France
    jucrouzet _(a t)_
    http://www.synten.com
    c2c Guest

  5. #5

    Default Re: where is the error please

    thank you it's ok now ;)


    "Stefan Rybacki" <net> a écrit dans le message de news:
    net... 
    > Its because in HTML new lines are represented by <br/> not by a normal
    > CRLF or similar. Look at your created HTML source. The new lines are there
    > but not shown in the browser. Just use print(nl2br($com)); to get what you
    > want.
    >
    > Regards
    > Stefan[/ref]


    Dave Guest

Similar Threads

  1. Replies: 0
    Last Post: March 29th, 09:49 PM
  2. Replies: 0
    Last Post: November 10th, 05:24 PM
  3. bulk insert error: 'Operating system error code 5(Access is denied.)'
    By Trint in forum Microsoft SQL / MS SQL Server
    Replies: 4
    Last Post: August 20th, 04:21 PM
  4. Replies: 1
    Last Post: August 7th, 07:13 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139