English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Hi,

I have a text area on my website which users use to fill out an about me section. But if they press return (enter) when I recall the text from the database, there is no line break in the text.

How can I get it so that when a user enters in their info and they press enter, it automatically breaks?

Thanks

2007-08-26 10:32:43 · 7 answers · asked by jeff lemon 1 in Computers & Internet Programming & Design

yes php to recall the info, how do i do that?

2007-08-26 10:46:57 · update #1

7 answers

Sorry Jeff, but you are becomming an annoyance.
You have asked over 150 questions on this site to get your own code to work.
You have received many good answers from decent people (working for a living).
You have not even acknowledged their replies.
You did not learnt anything from the answers you got (as your later questions are showing).
You have not made the slightest effort to learn anything.
You did not even bother to visit www.php.net to learn something (if you did, you would not ask silly questions).
WE are not here to do student's home work.
WE are not here to write YOUR code for you!
I hope others will refrain from giving you free answers to your professional problems.

2007-08-26 10:49:17 · answer #1 · answered by just "JR" 7 · 1 1

I guess I agree with JR, but I'm rather new here myself and well I recently did this in my code yesterday, so I guess i'll share it!

If you're using PHP
Before inserting the POST variable into the database

do $var = str_replace("\n","
", $var);

Replace $var with your variable

That will replace all new line slashes with
tags. So when you recall your text from the database it will show with BR Tags.

If you use any ANTI SQL Injection checks, it may clash so do this first then test the checks afterwards.

When allowing users to edit the field (using value=$var) var being the data selected from the database. You don't want to be seeing
so you do the same but do str_replace("
","\n",$var) so it turns all
into \n tags.

Simple

2007-08-26 11:32:54 · answer #2 · answered by stespeak 1 · 0 0

I have to agree with JR on this one. Why don't you go read through some tutorials online about PHP and MySQL? They would answer your questions much better and more efficiently. In fact, the main websites for PHP and MySQL are very good references.

2007-08-26 11:32:54 · answer #3 · answered by Nisovin 5 · 0 0

countless issues that helped unfold imperialism additionally helped unite diverse cultures and the person-friendly of existence for people. people outfitted roads for the troops to commute on and finally the roads made it elementary to head products and amenities in the process an greater distance. The roads helped connect the cities and cities and unfold imperialism custom into the country element. people began to dig the imperial look and how people in Rome lived so a number of places began development issues that appeared like places interior the capitol. Even less demanding: people interior the capitol cities had to unfold their administration into the encompassing aspects. maximum people have been completely down with it via fact it helped their high quality of existence.

2016-10-17 01:24:44 · answer #4 · answered by ? 4 · 0 0

in the function that recalls the text, just have it write break tags with it., are you using php to call the information?

2007-08-26 10:43:44 · answer #5 · answered by Asperon 2 · 0 0

It is good thing for you if you mention the code here from there i will guest where is problem so please send the whole code to me or concern department of url given below ...

http://www.commediait.com

2007-08-26 20:20:23 · answer #6 · answered by top s 3 · 0 0

Why bother? Why not use it as preformatted data?

2007-08-26 10:48:38 · answer #7 · answered by Anonymous · 0 0

fedest.com, questions and answers