Dear Bob, dear all,
I followed your suggestion and installed Active Perl for a local test. If I
run the script below, I get the following error:
Too late for "-T" option at C:\spriet.nl
When I remove the first line #!/usr/bin/perl -wT
i get the error:
Can't find string terminator "END_HTML"anywhere before EOF at C:\spriet.pl
line 31
Hope you can help ...
Henk van Ess
#!/usr/bin/perl -wT
use strict;
use CGI qw/:standard/;
use URI::Escape;
# if we came from the form, grab the values and create the URL
if ( param )
{
# get the form data
# see perldoc CGI
my $_prefix = param( 'prefix' ) || '';
my $_search = param( 'search' ) || '';
# untaint it
# see perldoc perlsec
my ( $prefix ) = ( $_prefix =~ /^([a-zA-Z\d\s_:]+)$/ ); #create
appropriate regex
my ( $search ) = ( $_search =~ /^([a-zA-Z\d\s_:]+)$/ ); #create
appropriate regex
# escape characters with special meaning in URIs
# see perldoc URI::Escape
$prefix = uri_escape( $prefix );
$search = uri_escape( $search );
print redirect(
"http://www.google.com/search?q=$prefix%20$search" );
}
# otherwise, print the Web page
else
{
print header;
print <<END_HTML;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Test page</title>
</head>
<body>
<form action="spriet.cgi" method="get">
<input type="checkbox" name="prefix" value="allintitle:" />
All in title<br />
<input type="text" name="search" />
<input type="submit" name="Submit" />
</form>
</body>
</html>
END_HTML
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]