Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > newbie question

Reply
Thread Tools

newbie question

 
 
hpi
Guest
Posts: n/a
 
      11-04-2003
Hi,

I have a cgi script generating text output I simply want to show
unformatted.

This text also contains stuff like: <hello>

I tried the <PRE> tag but the <hello> disappears, the browser thinks it's a
tag.

If I use <textarea> the <hello> says but wide lines get wrapped and I want
to use the horizontal scrollbar to see wide lines.

Which tag should I use?

tx

HPI


 
Reply With Quote
 
 
 
 
PeterMcC
Guest
Posts: n/a
 
      11-04-2003
hpi wrote:
> Hi,
>
> I have a cgi script generating text output I simply want to show
> unformatted.
>
> This text also contains stuff like: <hello>
>
> I tried the <PRE> tag but the <hello> disappears, the browser thinks
> it's a tag.
>
> If I use <textarea> the <hello> says but wide lines get wrapped and I
> want to use the horizontal scrollbar to see wide lines.
>
> Which tag should I use?
>


Try using the named character entities:
http://www.w3.org/TR/WD-html40-97070.../entities.html

&lt;hello&rt;
--
PeterMcC
If you feel that any of the above is incorrect,
inappropriate or offensive in any way,
please ignore it and accept my apologies.
 
Reply With Quote
 
 
 
 
Steve Pugh
Guest
Posts: n/a
 
      11-04-2003
"hpi" <(E-Mail Removed)> wrote:


>I have a cgi script generating text output I simply want to show
>unformatted.
>
>This text also contains stuff like: <hello>
>
>I tried the <PRE> tag but the <hello> disappears, the browser thinks it's a
>tag.


Of course. It is a tag.

>If I use <textarea> the <hello> says but wide lines get wrapped and I want
>to use the horizontal scrollbar to see wide lines.


<textarea> is for input, not output.

>Which tag should I use?


None.

Convert < to &lt; (and to be extra-safe > &gt; though that's not
strictly need in the majority of cases).

&lt;hello&gt;


Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>
 
Reply With Quote
 
Steve Pugh
Guest
Posts: n/a
 
      11-04-2003
"PeterMcC" <(E-Mail Removed)> wrote:

>&lt;hello&rt;


&rt;? What's that? Other than a typo?



Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>
 
Reply With Quote
 
Owen Jacobson
Guest
Posts: n/a
 
      11-04-2003
hpi wrote:

> Hi,
>
> I have a cgi script generating text output I simply want to show
> unformatted.


So send it to the browser as Content-Type: text/plain, not text/html.

(IE may still second-guess you if there's an <html> tag near the
beginning of the output.)
 
Reply With Quote
 
Alexander Duerloo
Guest
Posts: n/a
 
      11-04-2003
use the <plaintext></plaintext> tag

"hpi" <(E-Mail Removed)> schreef in bericht
news:3fa7c904$0$250$(E-Mail Removed).. .
> Hi,
>
> I have a cgi script generating text output I simply want to show
> unformatted.
>
> This text also contains stuff like: <hello>
>
> I tried the <PRE> tag but the <hello> disappears, the browser thinks it's

a
> tag.
>
> If I use <textarea> the <hello> says but wide lines get wrapped and I want
> to use the horizontal scrollbar to see wide lines.
>
> Which tag should I use?
>
> tx
>
> HPI
>
>



 
Reply With Quote
 
Steve Pugh
Guest
Posts: n/a
 
      11-04-2003
"Alexander Duerloo" <(E-Mail Removed)> wrote:

>use the <plaintext></plaintext> tag


That would be the <plaintext> tag that was listed as obsolete in HTML
2 and which doesn't even exist in HTML 4?

Good idea.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>
 
Reply With Quote
 
PeterMcC
Guest
Posts: n/a
 
      11-04-2003
Steve Pugh wrote:
> "PeterMcC" <(E-Mail Removed)> wrote:
>
>> &lt;hello&rt;

>
> &rt;? What's that? Other than a typo?
>
>
>


It's a typo (_8(<) Doh!

How about &lt;abd&gt; ?

Thanks, Steve. Must have got half way through and swapped to l/r as in
&*dquo; (which I use much more often) rather than l/g in &*t;
Attention span must be functioning at &lt;11 characters.


--
PeterMcC
If you feel that any of the above is incorrect,
inappropriate or offensive in any way,
please ignore it and accept my apologies.

 
Reply With Quote
 
Toby A Inkster
Guest
Posts: n/a
 
      11-04-2003
hpi wrote:

> I have a cgi script generating text output I simply want to show
> unformatted.
>
> This text also contains stuff like: <hello>


In Perl:

$out = $the_stuff_that_i_want_to_display;
$out =~ s#\&#&amp;#;
$out =~ s#\>#&gt;#;
$out =~ s#\<#&lt;#;
print "<pre>$out</pre>\n";

Demonstration perl script to run from the command line:

#!/usr/bin/perl
while ($out = <>) {
$out =~ s#\&#&amp;#;
$out =~ s#\>#&gt;#;
$out =~ s#\<#&lt;#;
print $out;
}


--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?id=132

 
Reply With Quote
 
hpi
Guest
Posts: n/a
 
      11-08-2003
"hpi" <(E-Mail Removed)> wrote in
news:3fa7c904$0$250$(E-Mail Removed):

> Hi,
>
> I have a cgi script generating text output I simply want to show
> unformatted.
>
> This text also contains stuff like: <hello>
>
> I tried the <PRE> tag but the <hello> disappears, the browser thinks
> it's a tag.
>
> If I use <textarea> the <hello> says but wide lines get wrapped and I
> want to use the horizontal scrollbar to see wide lines.
>
> Which tag should I use?
>
> tx
>
> HPI
>
>


thanks people for all your help.
Of course I know I should use the &lt; etc. but then I should write
some conversion program converting ALL of these things.
I wasn't up for that.

But it seems <XMP>tag <hello></XMP> works ok too.
However this one is replaced by <PRE> which doesn't leave the
tags alone.

anyway, thanks all

HPI
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VONAGE Newbie w/newbie question New_kid@nowhere.new VOIP 0 08-11-2007 01:40 PM
another newbie question from another newbie.... Lee UK VOIP 4 05-17-2005 04:10 PM
newbie: cisco vlan newbie question No Spam Cisco 3 06-07-2004 10:02 AM
dumb newbie question (or newbie dumb question) Jerry C. Perl Misc 8 11-23-2003 04:11 AM
Newbie! I'm a newbie! What's wrong with this program? Id0x Python 4 07-20-2003 11:40 PM



Advertisments