FAQ

On Friday 27 May 2011 13:48:21 Agnello George wrote:
Hi

I am using TT to display my data from my db ,


i insert the following data from a Front end using ( <textarea> ) into
my database the data is like this in mysql :

---------------------------------------------------------------------------
-----------+------+---------------+-------------+-------------+ LV Name
/dev/VolGroup01/zeeweblinux1
VG Name VolGroup01
LV UUID iqj9g1-qzfQ-IHyc-Ebov-CKNb-NIYQ-dZKBXF
LV Write Access read/write
LV Status available
# open 1
LV Size 50.00 GB
Current LE 12800
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:8
+-----------+------+-------------------------------------------------------
---------------------------------------------------------------------------
---------------------------------------------------------------------------
---------------------------------------------------------------------------
---------------------------------------------------------------------------
---------------------------------------------------------------------------
--------------------------------------+------+---------------+-------------
+-------------+

when i try to retrieve this data using TT i to put it in a hash , so here
is what my hash looks like :

$VAR1 = [ { 'result' => { 'lvm' => 'LV Name /dev/VolGroup01/blinux1 VG
Name VolGroup01 LV UUID iqj9g1-qzfQ-IHyc-Ebov-CKNb-NIYQ-dZKBXF LV Write
Access read/write LV Status available # open 1 LV Size 50.00 GB Current LE
12800 Segments 1 Allocation inherit Read ahead sectors auto - currently
set to 256 Block device 253:8 ', } } ];


ultimately it it gets displayed without the new-line character :

LV Name /dev/VolGroup01/blinux1 VG Name VolGroup01 LV UUID
iqj9g1-qzfQ-IHyc-Ebov-CKNb-NIYQ-dZKBXF LV Write Access read/write LV Status
available # open 1 LV Size 50.00 GB Current LE 12800 Segments 1 Allocation
inherit Read ahead sectors auto - currently set to 256 Block device 253:8


is there a way i can display on my browser with a new-line or <br/>
First of all, make sure you avoid HTML-injection/cross-site-scripting (XSS)
attacks:

http://community.livejournal.com/shlomif_tech/35301.html

Then you can use something like:

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

to put line breaks in the HTML.

Regards,

Shlomi Fish

--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Optimising Code for Speed - http://shlom.in/optimise

We have nothing to fear but fear itself. Fear has nothing to fear but XSLT.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 9 | next ›
Discussion Overview
groupbeginners @
categoriesperl
postedMay 27, '11 at 10:48a
activeMay 29, '11 at 6:34p
posts9
users3
websiteperl.org

People

Translate

site design / logo © 2021 Grokbase