Redhead
05-20-2003, 10:51 AM
Hi everyone!
I'm working on a small page where i'm i want to give a password to someone and they can enter it into a html file and if they enter it in right then it takes them to antoher page.
this is what i have
#!/usr/local/bin/perl -wT
use strict;
use CGI ':standard';
print "Content-type: text/html\n\n";
my $ReadOut = param('ReadOut');
my $filename;
if ($ReadOut=~/123456/) {
$filename = "http://www.blablabla.com/blablabla/page2.htm";
} else {
print "Sorry, you can not access this page.";
}
open (FILE, "http://www.blablabla.com/blablabla/$filename") || &Error('open','file');
my @page = <FILE>;
close FILE;
foreach (@page) {
print;
}
sub Error {
print "Content-type: text/html\n\n";
print "The server can't $_[0] the $_[1]: $! \n";
exit;
}
what do you think should this work.
Thanks Redhead :confused:
I'm working on a small page where i'm i want to give a password to someone and they can enter it into a html file and if they enter it in right then it takes them to antoher page.
this is what i have
#!/usr/local/bin/perl -wT
use strict;
use CGI ':standard';
print "Content-type: text/html\n\n";
my $ReadOut = param('ReadOut');
my $filename;
if ($ReadOut=~/123456/) {
$filename = "http://www.blablabla.com/blablabla/page2.htm";
} else {
print "Sorry, you can not access this page.";
}
open (FILE, "http://www.blablabla.com/blablabla/$filename") || &Error('open','file');
my @page = <FILE>;
close FILE;
foreach (@page) {
print;
}
sub Error {
print "Content-type: text/html\n\n";
print "The server can't $_[0] the $_[1]: $! \n";
exit;
}
what do you think should this work.
Thanks Redhead :confused: