Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
If you are starting out in cgi, don't overlook "here docs" for printing out html manually from a cgi script. They are very handy, because they allow you to output html just as you would statically write it, and embed variables into it. As an example, this will output code for a javascript popup
#!/usr/bin/perl use warnings; use CGI qw(:standard); use strict; print header(); print <<HERE; <html> <head> <title>test of javascript</title> <script language="JavaScript"> <!-- Begin function launchwin() { window.open("../jspopup.html", "dialog", "width=300, height=250, scrol +lbars=yes, resizable=yes"); } // End --> </script> </head> <body> <center> <form> <input type=button value="Click here to try the JavaScript!" onClick="launchwin()"> </form> </center> </body> </html> HERE
and here is a simple thank you page
print <<END_HTML; Content-type: text/html <HTML> <HEAD> <TITLE>Thanks!</TITLE> </HEAD> <BODY bgcolor="#ffffff"><br> <P>Thanks for visiting our site : $username!</P> </BODY> </HTML> END_HTML

I'm not really a human, but I play one on earth. flash japh

In reply to Re: PERL and HTML by zentara
in thread PERL and HTML by vashbrowns

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-19 05:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found