in reply to Stuck
To be honest, I'm not sure that you're URL is legal. Try a url like the following:
/path/to/script/myscript should be the path and name of your script. where=somval is a name value pair that gets passed to the query string.http://lezar.org/path/to/script/myscript?where=someval
Then, use CGI to get the name/value pairs. You also shoudl use taint checking (that's the -T switch on the shebang line) and use strict to catch all sorts of problems. Here's an updated version of what you want to do:
See perlsec for information on the security issues and you can also check out my online CGI course for further information. It's not complete, but it should give you a good start.#!/usr/bin/perl -wT use strict; use CGI qw/:standard/; my $taintedWhere = param( 'where' ); my $where = ( $taintedWhere =~ /(\w+)/ ); if ( $where eq 'Front' ) { print header; print <<" Mn"; Some HTML Mn } elsif ( $where eq 'WebMail' ) { print header; print <<" WbMl"; Some more HTML WbMl } else { # $where is not what we expect, so we have an error routine here; }
For easier debugging, try adding the following line to your script:
That will usually print useful debugging information to the browser. Just make sure that you remove this when you put the script on a production server! There's no sense proving crackers with additional information about how your script works.use CGI::Carp qw( fatalsToBrowser );
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: (Ovid) Re: Stuck
by Fastolfe (Vicar) on Dec 16, 2000 at 06:02 UTC | |
by Ovid (Cardinal) on Dec 16, 2000 at 09:37 UTC | |
Re: (Ovid) Re: Stuck
by cwest (Friar) on Dec 16, 2000 at 01:49 UTC |