MrPhreaker
Programmer
Good morning all
I have cgi-scripts running on my webserver in location
f:\Oracle\Apache\Apache\cgi-bin\
and my htdocs is
e:\Sofia\
The script is :
#!c:/Perl/bin/perl.exe
require ("cgi-lib.pl");
&ReadParse(*form);
$user = $form{'user'};
$pass = $form{'pass'};
####################################################################
#Start here to edit the 5 variables that may need to be changed #
####################################################################
# Edit Variable #1 of 5
#Set #!/usr/bin/perl at the top line 1 to point to your Perl interpretor
#Usually #!/usr/bin/perl or #!/usr/local/bin/perl
# Edit Variable #2 of 5
#Replace "california" on next line with your own username
$myusername = "so";
# Edit Variable #3 of 5
#Replace "raisins" on next line with your own password
$mypassword = "mi";
# Edit Variable #4 of 5
#Replace "granted.txt" on next line with your own file to be displayed when user/pass is correct
$protectedfile = "e:\Sofia\new\index.htm";
# Edit Variable #5 of 5
#Replace "denied.txt" on next line with your own file to be displayed when user/pass is incorrect
$accessdeniedfile = "denied.txt";
#That's it for this file Install Step #2. Now go to Install Step #3 on the readme.txt file.
####################################################################
#End of variable selection DO NOT edit below this line #
####################################################################
print "Content-type: text/html\n\n";
if ($mypassword eq $pass && $myusername eq $user)
{
open (granted, "$protectedfile");
@granted=<granted>;
print "@granted";
close (granted);
}
else
{
open (denied, "$accessdeniedfile");
@denied=<denied>;
print "@denied";
close (denied);
}
####################################################################
#This script created by Steve Baker ( July 07, 2000#
####################################################################
However, the default pointing to granted.txt works but when I put in a path like:
e:\Sofia\new\index.htm
results in an error stating that it cannot find the page. The page itself can be navigated to without problems normally when not using the script.
Please can someone advise me as to how to put in the correct path so that my index page is shown ?
Many thanks
Greg
I have cgi-scripts running on my webserver in location
f:\Oracle\Apache\Apache\cgi-bin\
and my htdocs is
e:\Sofia\
The script is :
#!c:/Perl/bin/perl.exe
require ("cgi-lib.pl");
&ReadParse(*form);
$user = $form{'user'};
$pass = $form{'pass'};
####################################################################
#Start here to edit the 5 variables that may need to be changed #
####################################################################
# Edit Variable #1 of 5
#Set #!/usr/bin/perl at the top line 1 to point to your Perl interpretor
#Usually #!/usr/bin/perl or #!/usr/local/bin/perl
# Edit Variable #2 of 5
#Replace "california" on next line with your own username
$myusername = "so";
# Edit Variable #3 of 5
#Replace "raisins" on next line with your own password
$mypassword = "mi";
# Edit Variable #4 of 5
#Replace "granted.txt" on next line with your own file to be displayed when user/pass is correct
$protectedfile = "e:\Sofia\new\index.htm";
# Edit Variable #5 of 5
#Replace "denied.txt" on next line with your own file to be displayed when user/pass is incorrect
$accessdeniedfile = "denied.txt";
#That's it for this file Install Step #2. Now go to Install Step #3 on the readme.txt file.
####################################################################
#End of variable selection DO NOT edit below this line #
####################################################################
print "Content-type: text/html\n\n";
if ($mypassword eq $pass && $myusername eq $user)
{
open (granted, "$protectedfile");
@granted=<granted>;
print "@granted";
close (granted);
}
else
{
open (denied, "$accessdeniedfile");
@denied=<denied>;
print "@denied";
close (denied);
}
####################################################################
#This script created by Steve Baker ( July 07, 2000#
####################################################################
However, the default pointing to granted.txt works but when I put in a path like:
e:\Sofia\new\index.htm
results in an error stating that it cannot find the page. The page itself can be navigated to without problems normally when not using the script.
Please can someone advise me as to how to put in the correct path so that my index page is shown ?
Many thanks
Greg