#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2000
    Posts
    0
    Rep Power
    0
    Here's the deal, a user enters info into a text form field and it is the added to a text file database. I am having trouble because if the user hits enter in the form field it will skip lines in the text file database, which casues the database to get all wacky. I am wondering if anyone knows of a way to turn those returns into "<br>" or to just delete them all together. Any input would be greatly appreciated! Thank you!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2000
    Posts
    452
    Rep Power
    15
    $input{'formFieldName'} =~ s/r//g; #get rid of carriage returns
    $input{'formFieldName'} =~ s/n{2,}/<P>/g; #substitute multiple newlines with one paragraph tag
    $input{'formFieldName'} =~ s/n/<BR>/g; #substitute any remaining newlines with line break tags

IMN logo majestic logo threadwatch logo seochat tools logo