in reply to HTML printing
Two ways to get the query string value. You can get the whole query string with my $qstr = $ENV{QUERY_STRING}; and then parse it yourself to get the page reference.
Better would be to
Then, as before, branch to or select the routine to print the specific page. You can use heredocs or normal print statements, or a mixed combination of the two, whatever does the job.use CGI my $cgi = CGI::new() or die "Can't load new CGI"; my $page = $cgi->param('page');
In printing your various HTML pages, you can then include the <a....> links you need with the appropriate query strings for the other pages. Like this: <a href="http://my.server.com/multipage.pl?page=2">Show page 2</a> You can also have subroutines to spit out portions of the HTML if you have repeated sections. And you can use conditionals to deliver pieces depending on whatever you want (username, requested page, etc.)
If you want more query string values in one url in order to do cool things, just separate them with '&'. Update: Which of course, you must write as & (see next post -- thanks merlin).
I recommend you check out the CGI module. You may not feel you need it for this simple exercise, but this project would be a good way to get to know it for later. It is a powerful, versatile, and well-tested module.
Also, if you want to know more about what is being passed from your browser and is capturable by Perl, here is a page that may help you.
There is also some magic involving HTTP (not HTML) headers that you need to take care of. The CGI module can help with this. Or, at the very least, just be sure to print "Content-type: text/html\n\n"; before anything else. (Note the double NewLine.)
If you need more than this to get you going, just re-post. Good luck.
dv
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: HTML printing
by merlyn (Sage) on Feb 17, 2001 at 08:41 UTC | |
by dvergin (Monsignor) on Feb 17, 2001 at 09:46 UTC | |
by merlyn (Sage) on Feb 17, 2001 at 10:01 UTC | |
by dvergin (Monsignor) on Feb 17, 2001 at 10:14 UTC |