Page 1 of 1

Best way to format user input from forms

Posted: Sat Feb 03, 2007 7:06 pm
by twilightnights
Anyone know a good way to do this?

Here is an example on my site.. I copied a joke for testing.. here is version with pre tags and set the font to sans serif via CSS

http://www.omgjokes.com/random.php?i=98

without pre
http://www.omgjokes.com/random.php?i=97

But the pre has a problem.. it scrolls way off the page. Is there a way to limit how much text is on one line with pre and make it wrap?

Posted: Sat Feb 03, 2007 7:19 pm
by feyd
If memory serves, <pre> is a block level statement therefore unless otherwise specified will be as wide as required to contain your text. wordwrap() may be of interest.

Posted: Sat Feb 03, 2007 8:14 pm
by twilightnights
feyd wrote:If memory serves, <pre> is a block level statement therefore unless otherwise specified will be as wide as required to contain your text. wordwrap() may be of interest.
sweet wordwrap works well, ty