php forum
php mysql forum
php mysql smarty
 
Topic Options
#101104 - 04/26/00 09:53 AM How do the make the RETURN key return?
RangerRob Offline
Member

Registered: 01/26/00
Posts: 40
Loc: England.
I have been playing around with perl for a qhile now and one of the things I love about the UBB which so far I have been unable to figure out is how do UBB make it so that when the RETURN key is pressed it shows the new line in the final post?
Basically what happens when I try this is I put up an input box and whilst it all looks great in there, when it comes to viewing the post all the words are wrapped one the same line (i.e. the return paragraphing has been cancelled out).
Does anybody know how to fix this?

Thanks in advance.

Top
#101105 - 04/26/00 10:12 AM Re: How do the make the RETURN key return?
MC_Mouse Offline
Junior Member

Registered: 03/16/00
Posts: 6
Loc: Fredericton, NB, Canada
When something is sent from a text box, the enter that was pressed is actually sent as an escape code: r (and n is new line)

to change these into html br's, try this:
Code:
code:


you may wish to do the same for n.

(someone correct me if i messed up the code, been doing too much VB these days)

-MC_Mouse
_________________________
-MC_Mouse

Top
#101106 - 04/26/00 10:33 AM Re: How do the make the RETURN key return?
cal Offline
Programmer

Registered: 02/19/99
Posts: 3433
Loc: London, UK | Genius: 100%
Almost...

Code:
code:


Not all system generate r so use n and delete all r.

Just a thought
_________________________
http://www.iamcal.com

Top
#101107 - 04/26/00 02:21 PM Re: How do the make the RETURN key return?
RangerRob Offline
Member

Registered: 01/26/00
Posts: 40
Loc: England.
Thanks a lot guys for some reason no matter how much perl I do the one thing that I can never get the hang of is all the string handling (i.e. escape functions).
Do any of you have a good way (i.e. a tactic) to remember what they all mean?

Top
#101108 - 04/26/00 02:25 PM Re: How do the make the RETURN key return?
cal Offline
Programmer

Registered: 02/19/99
Posts: 3433
Loc: London, UK | Genius: 100%
there are very few you really need.

n is new line
r is carriage return
t is tab

Just a thought
_________________________
http://www.iamcal.com

Top
#101109 - 04/26/00 02:44 PM Re: How do the make the RETURN key return?
MC_Mouse Offline
Junior Member

Registered: 03/16/00
Posts: 6
Loc: Fredericton, NB, Canada
I use the book "Programming perl" it remembers FOR me. smile (of course, i don't have it here -- doh)

but, perl.com has all that wonderful stuff too.

cal: is there any characteristical difference between n and r? Also, is there any real use for the s switch? i always use it just to be sure my var is taken as a string.

-MC_Mouse
_________________________
-MC_Mouse

Top
#101110 - 04/27/00 04:26 AM Re: How do the make the RETURN key return?
cal Offline
Programmer

Registered: 02/19/99
Posts: 3433
Loc: London, UK | Genius: 100%
Is is supposed to mean "Treat input as a single line". I think you use it without g to replace once per line.

n = character 10
r = character 13

Windows generates 13-10 sequences, unix does 10 and MacOs does 10-11 (or something stupid)

Just a thought
_________________________
http://www.iamcal.com

Top
#101111 - 04/28/00 05:16 AM Re: How do the make the RETURN key return?
RangerRob Offline
Member

Registered: 01/26/00
Posts: 40
Loc: England.
Thanks again for your help with my original problem guys, I have another question on the same sort of thing though...
How can I make it so that another character is a deliminator acting as a string splitter?

So, i.e. How could I make it so that the string "11AB&22AB&33AB" can become three strings "11AB", "22AB", "33AB", using the "&" part of the original string as a splitter to determine the seperations required?

Top
#101112 - 04/28/00 05:32 AM Re: How do the make the RETURN key return?
cal Offline
Programmer

Registered: 02/19/99
Posts: 3433
Loc: London, UK | Genius: 100%
$stuff = "one&two&three";
@array = split(/&/,$stuff);

Just a thought
_________________________
http://www.iamcal.com

Top
#101113 - 04/28/00 09:42 AM Re: How do the make the RETURN key return?
RangerRob Offline
Member

Registered: 01/26/00
Posts: 40
Loc: England.
Thanks a lot Cal, you are da man!!

Top



Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks