in reply to HTML error routine
How do I get it to go to a frame called "stuff" in a framed website?
We don't have enough code to know everything that you're doing, but here's a start. Assuming that you are using CGI.pm:
#!/usr/bin/perl -wT use strict; use CGI qw/:standard/; # use this where you would ordinarily have # print "Content-Type: text/html\n\n"; print header( -target => 'stuff' ); my $_patent = param( 'patent' ); # see 'perldoc perlsec' # $patent is set to digits or zero my ( $patent ) = ( $_patent =~ /^(\d+)$/ ) || 0; if ( $patent < 1 or $patent > 6000555 ) { send_error_page(); } else { # patent number is good, let's process it } sub send_error_page { print <<ENDERRORCARD; <HTML> <HEAD> <TITLE>Data Entry Error</TITLE> </HEAD> <BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EE" VLINK="# +551A8B" ALINK="#FF0000"> <CENTER> Patent number must be a number between 1 and 6000555, inclusiv +e.<BR> Use your browser's BACK option to try again. </CENTER><P> </BODY> </HTML> ENDERRORCARD }
If you're not sure what I'm doing with the regular expression, please read perlsec.
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|
|---|