|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||||
|
|||||
|
Well, as everyone knows, not everyone knows how to use the <br> tag when posting on a website, and that is my problem. I want to have my input be automatically parsed when you hit enter
to get a new line like this. I've been looking round the web and haven't found any info on how to do this. if anyone has any insite you help would be gratly appriciated. p.s. Brandon, why do you have the spell checker commented out in the source for pages? does it not work? |
|
#2
|
||||||
|
||||||
|
Where are you trying to do this? In a form? In an WYSIWYG editor? Either way, new lines are normally denoted by a '\n' character, if that helps any.
|
|
#3
|
|||||
|
|||||
|
im talking about text box input through html forms, like the ones used to post these messages. For example you hit enter 3 times you would get spaces in the text, but i need to convert that to \n or <br> tags
|
|
#4
|
||||
|
||||
|
Well, if the script parsing the HTML form is written in PHP, you can simply use the nl2br() function. Lets say the textbox input is saved to the variable $info. To convert all the newline characters present in it, you would do:
Code:
$info = nl2br($info); |
|
#5
|
|||||
|
|||||
|
Joel suggested the correct PHP function.
To do it in PERL, you could do this: Code:
$someText =~ s/\n\n/<p>/g; $someText =~ s/\n/<br>/g; vBulletin has it commented out by default, because I believe the service they were using started to charge people. They just leave the code there in case you want to pay for the service, I think. |
|
#6
|
|||||
|
|||||
|
thanks, i prolly should have said that i was using php.
Vbulletin make you pay for everything now doens't it. how much is a liscence up to now? |
|
#7
|
|||||
|
|||||
|
vBulletin doesn't make you pay for the spell checker, the spell checker service makes you pay for it.
vBulletin is $35/yr, which really isn't that bad for such a powerful piece of software that is continually updated, and fully customizable. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Listen-to xml parsing example thingie | Trashed20 | Website Design/Showcase | 4 | 27-03-2003 15:13 |
| Sprockets and Roller Chain Models | Madison | Inventor | 3 | 04-02-2003 11:51 |
| iParts on firstcadlibrary.com | Ed Sparks | Inventor | 3 | 08-01-2003 23:30 |
| approach to autonomy | Mike375 | Programming | 32 | 08-01-2003 14:04 |
| emulationFIRST v0.04 | Matt Leese | Programming | 7 | 09-07-2002 08:54 |