On Wed, 3 Aug 2005, Luinrandir wrote:
> The following does not work....
Define "does not work". It seems to work for me:
$ lynx -mime_header http://localhost/test.pl
HTTP/1.1 200 OK
Date: Thu, 04 Aug 2005 00:49:32 GMT
Server: Apache/1.3.33 (Darwin) mod_perl/1.29
Connection: close
Content-Type: text/html
<HTML><HEAD><TITLE>Seneschals
Report</TITLE></HEAD><BODY>1</body></html>Content-type: text/html
<HTML><HEAD><TITLE>Seneschals Report</TITLE></HEAD><BODY>2</body></html>
$
What are you trying to do? THis may not be what you meant, but it works
just fine. The HTML isn't standards compliant, but it produces results
that will show up in most web browsers.
If you want two different pages, you'll have to insert code that follows
different paths depending on some condition or conditions. That way,
when the page is loaded, the result can vary depending on the input and
other factors; the user will get one version or the other.
If you want one request to produce two separate pages, that isn't
possible. The closest thing I can think of would bee to have a call in
the HTML source that, on load, fires off a second page. Something like:
#!/usr/bin/perl
use strict;
if ($ENV{QUERY_STRING} ) {
print qq|Content-type: text/html\n\n|,
qq|<HTML><HEAD><TITLE>Seneschals Report</TITLE></HEAD>\n|,
qq|<BODY javascript:onload("/path/to/second/url")>\n|,
qq|1\n|,
qq|</body></html>\n|;
} else {
print qq|Content-type: text/html\n\n|,
qq|<HTML><HEAD><TITLE>Seneschals Report</TITLE></HEAD>\n|,
qq|<BODY>\n|
qq|2\n|,
qq|</body></html>\n|;
}
Or something like that.
--
Chris Devers
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>