Dear Monks,

I have two CGI's. One that stores form input in a MySQL database. The other an Admin page to view the user input in nicely formated tables. One of the input fields is really large for posting spam with complete headers. The problem is that the spam is sometimes html-laden which makes it very ugly when it is viewed through the admin CGI.

Is there a way to view the spam in plain-text form via the CGI? Or do I have to strip out the html first?

Here is the code that displays the content.

sub full_report { my $row = shift; print "<HR>", strong("Full Report"); print "<TABLE BORDER=1>"; my $edit_url = sprintf ("%s?choice=edit;id=%d", url(), + $row->{id}); my $delete_url = sprintf ("%s?choice=delete;id=%d", ur +l(), $row->{id}); my $full_report_url = sprintf ("%s?choice=full_report; +id=%d", url(), $row->{id}); print "<TR>", "<TD>$row->{id}</TD>", "<TD>$row->{date}</TD>", "<TD>$row->{summary}</TD>", "<TD>$row->{type}</TD>", "<TD>", "[", a({-href => $delete_url}, + "Delete"), "]", "[", a({-href => $edit_url}, " +Edit"), "]", "[", a({-href => $full_report_ +url}, "Full Report"), "]", "</TD>", "<TR><TD COLSPAN=6>$row->{mess +age}</TD></TR>", "</TR></TABLE>"; }

Edit kudra, 2002-06-06 Changed title, added p


In reply to Escaping HTML tags (was: Content-Type: text/html;) by amearse

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.