note
newrisedesigns
<p>Every page element that is not the HTML of the page requires a seperate request/response. For example, a simple HTML page with two images and a linked CSS requires 4 HTTP connections (one for the page, the CSS, and one for each image). </p>
<p>You could roll the HTML and the image into one script.</p>
<p>Sample page:</p>
<code>
<html>
<head>
<title>This is my page!</title>
</head>
<body>
<p>A line of text</p>
<img src="index.pl?image=img01">
</body>
</html>
</code>
<p>The perl:</p>
<code>
use strict;
use CGI;
my $q = CGI->new();
my $image = $q->param("image") or '';
if($image ne ''){
print $q->header("image/gif");
## print out the rest of image here
}
else{
print $q->header();
print $q->start_html("This is my page!");
## print out HTML here...
}
</code>
<p>Untested. While you're here... [id://101|SIGN UP]!</p>
<p>John J Reiser<br>
<a href="http://www.newrisedesigns.com/">newrisedesigns.com</a></p>
234109
234109