Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Yet another humble begging of answers from wiser monks:

I have a form with textareas on it where I am setting the wrap to physical.

The form is submitted using a Perl CGI script which saves the data to a MYSQL database. Checking the database contents reveals that I am saving the data with carriage returns and line feeds. However, when I print the data back out to a Web page, the line feeds are stripped. Thus, the users cannot format their text into paragraphs.

Using PRE tags allows the line feeds to show up, but then the each line scrolls off the right edge of the screen. I've tried setting the table width to 100% and also tried setting it to 800 pixels, both to no avail. How do I get around this?

I am thinking that a perl substitution like this would work:

s/stuff to substitute/<P>\\n/g;
The problem is, I don't know what belongs in "stuff to substitute."

In reply to Problem displaying text with CGI by Ovid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-04-24 01:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found