[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-WebCGI] Printing Scripts to Browser



At 2:13 PM -0700 1999/6/14, Richard Gordon wrote:
s very odd to look at.
>
>Anyway, does anyone know how to render html tags inert when they are
>printed from a script to the browser? I've pasted in what I am using
>at the moment and am looking for something that would tell the
>browser to ignore the tags, yet still present them as ordinary text
>in the window. Thanks.
>

I've seen done two ways.
1) if you just want to dump the source code to screen, don't tell the
browser it's an HTML document.  Instead, tell it it's a text file.

2) replace < with &lt; as you output each string.  This makes it untag like
and will not be interperted. > I believe is &gt;  You may want to replace
all the other special characters that may appear in your script too (& and
").  A list of the special codes for HTML 4.0 (I think these are the same
characters as other HTML specs used) can be found at:
http://www.w3.org/TR/1998/REC-html40-19980424/charset.html#h-5.3.2

Kevin

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org