Jump to content


Photo

PHP form <BR>


  • Please log in to reply
3 replies to this topic

#1 erfg1

erfg1
  • Members
  • PipPip
  • Member
  • 18 posts

Posted 06 October 2006 - 05:26 AM

When I made my form php powered, and you fill out a <TEXTAREA>, it does spaces, but the spaces dont show when displaying the mysql content onto a website. How would I make it so you can do <BR>'s instead of mysql's space downs. I assume it has something to do with str_replace.

#2 hostfreak

hostfreak
  • Members
  • PipPipPip
  • Advanced Member
  • 581 posts

Posted 06 October 2006 - 05:31 AM

Check out http://www.php.net/nl2br . I am pretty sure it will do what you are seeking.

#3 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 06 October 2006 - 05:36 AM

It do not do spaces, it actually makes line breaks, but linebreaks show up as spaces when the HTML is rendered and the <br> ('break line' or something like that) represents the line break. In order to convert the line breaks into HTML line breaks you would have to use the function hostfreak showed you or make one yourself, but making a function that already exists would be sort of stupid.

#4 erfg1

erfg1
  • Members
  • PipPip
  • Member
  • 18 posts

Posted 06 October 2006 - 05:38 AM

Thank you very much hostfreak. That was exactly what I was looking for.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users