SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Line Breaks

  1. #1
    SitePoint Member
    Join Date
    Mar 2001
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have an MySQL database with text field

    and a form that submits from a text field and inserts into the database.

    Is there anyway to retain the paragraphs from the form?

    curently if if someone types;

    ' hello

    hello2

    hello3
    '
    a query dispays 'hello hello2 hello3' when i want it to come out as typed.

    thanks for any help.
    Last edited by 5thFusion.com; Apr 12, 2001 at 12:51.
    5thFusion.com Reliable Linux Hosting
    http://www.5thfusion.com

  2. #2
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    wrap="hard".
    Here's an example from some code of mine:

    <textarea name="long" rows="15" cols="15" wrap="hard">

    Now when you are processing the the form data, before you insert the string into the database you need to addslashes() and stripslashes() to remove the extra slashes when you retrieve the string from the database.

    eg;
    $long = addslashes($long);
    $long = stripslashes($long);


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
  •