PDA

View Full Version : guestbook problem



Steven
April 10th, 2001, 21:53
Ok, this is the first original perl script that i have created: http://www.rzforum.f2s.com/cgi-bin/boardindex.cgi

I have a problem. When you post a message it works, the message gets added and all is good, however, i cannot get line breaks to show up in the posts.

If you start a new paragraph when you are writing your post and submit it, it will be added, but it ignores all line breaks unless you use an html tag.

This isnt going to work for my script. I want it to include all line breaks when you hit "enter" or "return". I dont know how to get it to do this. If anyone knows how, please tell me how so i can keep expanding this script.

Thanks

Omari
April 11th, 2001, 01:53
using < br > line breaks work

Steven
April 11th, 2001, 13:21
Well yes that doe work but not everyone will know that. Can you translate all line breaks into a br tag? That would work, but i would need to know the symbol or letter for when you press enter in oder to do that

akersche
April 11th, 2001, 14:05
I choose an easy way. just explained it to the users of my website, before they sign my guestbook.

check out:
http://books.dreambook.com/akersche/guestbook.sign.html

Greetings
Arno

melz
April 11th, 2001, 19:33
Well, I'm assuming that whatever that was enter for the "text" field is written to a file exactly the way it is and output as a html the same way.

So, for processing your "text" field, add this:



$text =~ s/\n/<br>/g;


Just work around that.