Hi Perl Monks,
I really tried to figure this out, but am just stuck. This is for a class and I actually do very little cgi perl.
Anyway, I am just trying to understand how to produce html code, in perl, that succesfully sets the location of objects.
Here is some example html:
<html>
<head><title>Message Main Menu</title></head>
<h1><font color=green>Message Main Menu</font></h1>
<body>
<form action="../cgi/messages.pl" method=post>
<input type=submit name=query_messages value = "Query Messages" s
+tyle="position:absolute; left:80 width: 20em"><br><br>
<input type=submit name=add_message value = "Add Message" style="
+position:absolute; left:80 width: 20em"><br><br>
<input type=submit name=modify_message value = "Modify Message" s
+tyle="position:absolute; left:80 width: 20em"><br><br>
<input type=submit name=delete_message value = "Delete Message" s
+tyle="position:absolute; left:80 width: 20em">
</form>
</body>
</html>
There are spots where I want to return to this form and I am using perl. Here is an example of the perl:
sub main_menu
{
print "<html>";
print "<head><title>Message Main Menu 2</title></head>";
print "<h1><font color=green>Message Main Menu 2</font></h1>";
print "<body>";
print "<form action=\"../cgi/messages.pl\" method=post>";
print "<input type=submit name=query_messages value = \"Query Mess
+ages\" style=\"position:absolute; left:80 width: 20em\"><br><br>";
print "<input type=submit name=add_message value = \"Add Message\"
+ style=\"position\:absolute; left\:80 width\: 20em\"><br><br>";
print "<input type=submit name=modify_message value = \"Modify Mes
+sage\" style=\"position\:absolute; left\:80 width\: 20em\"><br><br>";
print "<input type=submit name=delete_message value = \"Delete Mes
+sage\" style=\"position\:absolute; left\:80 width\: 20em\">";
print "</form>";
print "</body>";
print "</html>";
}
AND IT JUST DOESN'T DO IT!
I even wrote this snippet with a file handle and looked at the output. It looks IDENTICAL to the html code.
What am I missing? How can the perl produce the identical output, NOT cause the submit objects to have their locations and sizes defined by the code, but the html (on its own) does cause the objects to be located and sized as defined?
And if this just doesn't work, what is an alternative approach?
Really dismayed,
Tony
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.