newbie question

Discussion in 'HTML' started by hpi, Nov 4, 2003.

  1. hpi

    hpi Guest

    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
    hpi, Nov 4, 2003
    #1
    1. Advertising

  2. hpi

    PeterMcC Guest

    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-970708/sgml/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.
    PeterMcC, Nov 4, 2003
    #2
    1. Advertising

  3. hpi

    Steve Pugh Guest

    "hpi" <> 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 <> <http://steve.pugh.net/>
    Steve Pugh, Nov 4, 2003
    #3
  4. hpi

    Steve Pugh Guest

    "PeterMcC" <> 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 <> <http://steve.pugh.net/>
    Steve Pugh, Nov 4, 2003
    #4
  5. 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.)
    Owen Jacobson, Nov 4, 2003
    #5
  6. use the <plaintext></plaintext> tag

    "hpi" <> schreef in bericht
    news:3fa7c904$0$250$...
    > 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
    >
    >
    Alexander Duerloo, Nov 4, 2003
    #6
  7. hpi

    Steve Pugh Guest

    "Alexander Duerloo" <> 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 <> <http://steve.pugh.net/>
    Steve Pugh, Nov 4, 2003
    #7
  8. hpi

    PeterMcC Guest

    Steve Pugh wrote:
    > "PeterMcC" <> 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.
    PeterMcC, Nov 4, 2003
    #8
  9. 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
    Toby A Inkster, Nov 4, 2003
    #9
  10. hpi

    hpi Guest

    "hpi" <> wrote in
    news:3fa7c904$0$250$:

    > 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
    hpi, Nov 8, 2003
    #10
  11. hpi

    hpi Guest

    "Owen Jacobson" <> wrote in news:usRpb.120751
    $EO3.94990@clgrps13:

    > 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.)
    >


    I think this is the only good answer for me.

    I don't want to use HTML, I just want to see my plain output in a browser.
    I still have to test a little with tabs and stuff but this one works for
    me in IE6 and that's enough for now.

    thanks Owen!

    HPI
    hpi, Nov 8, 2003
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jerry C.
    Replies:
    8
    Views:
    205
    Uri Guttman
    Nov 23, 2003
  2. Kruno Saho
    Replies:
    0
    Views:
    125
    Kruno Saho
    Apr 7, 2013
  3. Dave Angel
    Replies:
    0
    Views:
    109
    Dave Angel
    Apr 7, 2013
  4. rusi
    Replies:
    0
    Views:
    99
  5. Miki Tebeka
    Replies:
    0
    Views:
    74
    Miki Tebeka
    Apr 7, 2013
Loading...

Share This Page