Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Community > Tech > [Php]Mantenere fromattazione in un textarea
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
Drake83
Fan di Splinter

User info:
Registered: Nov 2003
Posts: 1631 (0.20 al dì)
Location: Garbagnate milanese
Corso: Tutto finito
Anno:
Time Online: 108 Days, 5:46:38 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
[Php]Mantenere fromattazione in un textarea

Ciao! Come da oggetto volevo sapere se è possibile mantenere il formato di un testo immesso in un textarea. Ad esempio se in una pagina c'è un textarea e dentro vi scrivo

" ciaoo

ciaooo


ciaooo"

e passo come parametro post il valore di tale campo vorrei che la pagina ricevente mantenesse il formato immesso. So che è una domanda banale ma appunto come si fa a mantenere la formattazione?

Definendo molto semplicemente il textarea così :

<textarea name="domanda" ></textarea>

e stampando nella pagina ricevente il valore di $_POST[doamnda] mi scrive il testo in una riga unica.

Grazie :D

__________________
"io non sono come gli altri Robin Hood, io non ballo coi lupi"
"ogni mattina come narciso si specchia nel ruscello retrovisore", "ci sono mille modi per chiamare dio...dio,allha,adta,arauffa,crisma..afjasf...tanto non ti risponde"

Corrado Guzzanti è il mio Dio.
Roberto Saviano eroe nazionale.

06-11-2006 18:41
Click Here to See the Profile for Drake83 Click Here to See the Blog of Drake83 Click here to Send Drake83 a Private Message Find more posts by Drake83 Add Drake83 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
foolish
bleak

User info:
Registered: Oct 2003
Posts: 3585 (0.44 al dì)
Location:
Corso:
Anno:
Time Online: 36 Days, 7:28:56 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

devi utilizzare delle regex,
prova così.

PHP:

$text = preg_replace('/(\r|\n|\r\n)/','<br />',$_POST['textarea']);

__________________
The only way to discover the limits of the possible is to go beyond them into the impossible.
Arthur C. Clarke.

06-11-2006 19:49
Click Here to See the Profile for foolish Click Here to See the Blog of foolish Click here to Send foolish a Private Message Find more posts by foolish Add foolish to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
yeah
.grande:maestro.

User info:
Registered: Nov 2003
Posts: 1644 (0.20 al dì)
Location: Cologno Monzese
Corso: Informatica Magistrale
Anno: II
Time Online: 12 Days, 21:36:41 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Sì, è una questione di sostituire le sequenze di escape necessarie per passare il testo da una pagina all'altra in qualcosa di stampabile.

Prova quando dice foolish oppure guarda le varie funzioni di sostituzione in String functions

__________________
?

06-11-2006 21:31
Click Here to See the Profile for yeah Click here to Send yeah a Private Message Find more posts by yeah Add yeah to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Drake83
Fan di Splinter

User info:
Registered: Nov 2003
Posts: 1631 (0.20 al dì)
Location: Garbagnate milanese
Corso: Tutto finito
Anno:
Time Online: 108 Days, 5:46:38 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ok grazie mille :D

yeah un giorno o l'altro mi devo sdebitare rispondi sempre tu :asd:

Ciao!

__________________
"io non sono come gli altri Robin Hood, io non ballo coi lupi"
"ogni mattina come narciso si specchia nel ruscello retrovisore", "ci sono mille modi per chiamare dio...dio,allha,adta,arauffa,crisma..afjasf...tanto non ti risponde"

Corrado Guzzanti è il mio Dio.
Roberto Saviano eroe nazionale.

06-11-2006 21:36
Click Here to See the Profile for Drake83 Click Here to See the Blog of Drake83 Click here to Send Drake83 a Private Message Find more posts by Drake83 Add Drake83 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 06:07.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.198 seconds (43.83% PHP - 56.17% MySQL) con 25 query.