• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

guestbook problem

Steven

New Member
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
 
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
 
easy

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:

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

Just work around that.
 
Back
Top