I was thinking about using a key and token so that the perl script and the HTML is no longer interwoven and dependent... I have the script for that writen but havent combined the two..
# The code included below is used by Campus Crusade for Christ # with permission of Alphalogic Systems, Inc. # No portion of this code made be used or replicated without # permission. # PrintHeader # # Returns the magic line which tells WWW that we're an HTML document + # if a cookie existes, it sets the cookie also sub PrintHeader { print "Content-type: text/html\n"; if ($gCookieValue ne "") { &SetCookies($gCookieName,$gCookieValue); print "\n"; } else { print "\n"; } } # # SendTemplate # # This subroutine is used to display a web page template and then add +information # onto that template. The information comes from the tokens created by + the # perl script. sub SendTemplate { my ($template)=@_; my ($key, $filecontents); open (FILE, "$template"); # opens file containing web page template if (eof(FILE)==1) { # If file doesn't open, provides a basic web page with an error me +ssage. # Then proceeds to post raw data onto the web page. &PrintHeader(); $key = '<!--#title#-->'; print "<HTML><TITLE>$gTokens{$key}</TITLE><HEAD></HEAD><BODY> <H2> +Sorry, There has been an error in calling the Template.</H2>"; print "<P><H2>The information you requested is listed below.</H2>" +; foreach $key (sort keys %gTokens){ print "$key","\t", $gTokens{$key},"<P>\n"; } print "</BODY></HTML>"; return; } # The following commands will dump everything in the web template fi +le into $filecontents undef $/; $filecontents=<FILE>; close FILE; $/ = "\n"; # This loop will search $filecontents and replace any tokens found w +ith the HTML code # that the token is associated with in the hash %gToken hash. foreach $key (sort keys %gTokens){ $filecontents=~s/$key/$gTokens{$key}/g; } &PrintHeader(); print $filecontents; return true; }

In reply to Re: Re: MySQL Database Manager by hacker_j99
in thread MySQL Database Manager by hacker_j99

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.