Author |
Topic |
|
Id
Junior Member
USA
129 Posts |
Posted - 09 July 2001 : 14:47:24
|
I realize this isn't really an ASP question, but i'm hoping someone can point me in the right direction. In my quest to learn ASP and database integration, i've been tinkering around sorta building myself a really rudimentary forum of sorts. I've run into one snag. When i insert the data into my databse via a textarea it has line breaks and the like, but when I pull the data back out from the database, all my line breaks are gone, and all the text is turned into one big paragraph. Is there something i'm missing in setting up my table? or is there some sort of macro or the like I need to program into my table so it maintains my formatting.
Any help that can be offered would be much appreciated. Thanks
|
|
George_Zhu
Starting Member
China
46 Posts |
Posted - 10 July 2001 : 09:01:36
|
you have to use replace() to do this, and you can find such code in snitz code.
the simple way is replace(chr(30),"<br>"), something like this.
[font color=SlateBlue]Learning is all I want[/font] ----------------------- http://www.zhujie.org |
|
|
MorningZ
Junior Member
USA
169 Posts |
Posted - 10 July 2001 : 10:24:29
|
be sure to only to the replace when displaying the data, don't replace inserting into the DB, otherwise when you edit the memo field, the carriage returns will be gone and it'll be hard coded with "<br>"
so on display
Response.Write Replace( rst("thisMemo"), vbCrlf, "<br>" )
|
|
|
Id
Junior Member
USA
129 Posts |
Posted - 10 July 2001 : 15:32:25
|
I like it when it's simple stuff like that, thanks for your help :)
|
|
|
Spoon
Average Member
Ireland
507 Posts |
Posted - 11 July 2001 : 11:52:49
|
you could do it this way aswell
textbox = Request.Form("textbox") textbox = Server.HTMLEncode(textbox)
Spoon
"uohh look at me, ive got a signature, uohh look at me!" :) |
|
|
George_Zhu
Starting Member
China
46 Posts |
Posted - 11 July 2001 : 20:25:28
|
quote:
you could do it this way aswell
textbox = Request.Form("textbox") textbox = Server.HTMLEncode(textbox)
Spoon
"uohh look at me, ive got a signature, uohh look at me!" :)
I am sorry to say this will not working.
replace is the normal way to achieve UBB function, you can look through snitz code to see what it is.
[font color=SlateBlue]Learning is all I want[/font] ----------------------- http://www.zhujie.org |
|
|
Deleted
deleted
4116 Posts |
Posted - 11 July 2001 : 21:25:45
|
Look at the formatstring function in inc_functions.asp
Think Pink |
|
|
|
Topic |
|