SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 1999
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    First off, I just finished reading the sections I required from Beginning PH4 (recommended by this board) so I'm still slightly confused about certain aspects of PHP4.

    My currently problem is that I need to take a game review from the editor and post it on a database. I was planning on using a text box as the input method for the body of the review, but with all textboxes, I loose the <return> keys so everything comes out in one line.

    How can I solve this?

    Thank you for your time.
    Sincerely,
    HZ

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't worry about the line breaks until you get ready to pull the data from the database to display on your site. Leave the data like it is when it comes out of the textarea and store it like that in the db. When you pull the data out simply run nl2br()

    Code:
    $var = nl2br($var);
    This will add a <br> tag to each new line it finds. And your problems will be solved, but just don't store it in the db like that.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 1999
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow. Talk about fast reply.

    Thanks a lot, means a great deal. Love that it's that simple too.

    Once again, thanks.

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No problem and long live Degrassi Jr High!
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  5. #5
    SitePoint Addict zoordaan's Avatar
    Join Date
    Feb 2001
    Location
    NYC/Texas
    Posts
    348
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I haven't thought about that show in years :-) I saw it on public television, it was wonderful.


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
  •