The maxlength atttribute will prevent the casual user of your site from entering more characters in a text field than you have specified via this attribute. However, a cracker can simply save your form to his computer and delete the "maxlength" attribute, or increase its value. From there, it's a simple matter to make sure that the form still points to the correct URL and resubmit it with any length of data he wants in the appropriate input field.
CGI.pm runs the HTML together in one big, jumbled mess. CGI::Pretty allows you to have some control over the HTML formatting if you desire "nice looking" HTML.
<h1>Log in to my web site</h1>
<p>Enter your username and password:</p>
print $cgi->h1( "Log in to my web site" ),
$cgi->p( "Enter your username and password:" );
<table border="1">
<tr>
<td>This is a table cell.</td>
<td>This is another one.</td>
</tr>
<tr>
<td>Are we there yet?</td>
<td>I'm getting hungry!</td>
</tr>
</table>
print table( { -border => '1' },
Tr(
td( "This is a table cell" ),
td( "This is another one" )
), # end Tr
Tr(
td( "Are we there yet?" ),
td( "I'm getting hungry!" )
) # end Tr
); # end tableNote that 'Tr' is capitalized to avoid conflict with the tr/// operator.
| Back to Lesson 4 | Next Lesson: Reading Form Data |