Re: Display Problemo

From: Date: Tue, 20 Nov 2001 16:51:03 +0000
Subject: Re: Display Problemo
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-75260@lists.php.net to get a copy of this message
I see 2 possibilities to go and 1 warning: 1th way to go: you insert another field into your db called "originalCode" for example where you insert the code also but don't modify it at all. If someone wants to download the code you fetch the code from that field 2th way to go: you stay with only 1 field holding the code snippet and you don't change the code when inserting but you use nl2br when displaying. Needs a bit more processing time (I don't think it's a lot) but needs less disk space than 1th way warning: don't try to get rid of <BR> tags or other things afterwards because you could run into unsolvable problems (what when a coder has <BR> in his code? You could destroy it!) I hope I could help Stefan Rusterholz, s.rusterholz@interaktion.ch ---------------------------------- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich ---------------------------------- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch ---------------------------------- ----- Original Message ----- From: "Lerp" <joe@coastaldestination.com> To: <php-general@lists.php.net> Sent: Tuesday, November 20, 2001 5:27 PM Subject: [PHP] Display Problemo > I have a small php app that I'm building to display, insert, edit, etc... > various types of code snipits (asp, php, html, etc...) in a db. I also have > a download option that creates a text file with the code that they've > selected. > > I have 2 problems...the first is that when I go to view the text file I have > all sorts of <BR> tags within the text, this is due to the nl2br function I > used prior to the db insertion. How would I get rid of those? > > The seond problem is when a user goes to view an html code example on the > webpage, say with > a hyperlink, the hyperlink is made active replacing the code with the actual > <a href> tag. > > Thx in advance, Lerp > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > >

« previous php.general (#75260) next »