Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Password encryption script path help needed 3

Status
Not open for further replies.

MrPhreaker

Programmer
Jun 20, 2003
19
GB
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
 
Hello Greg,

Don't you need to say e:/Sofia/new/index.htm instead of e:\Sofia\new\index.htm?


Mike

"Deliver me from the bane of civilised life; teddy bear envy."

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

 
Alternately, you could put in e:\\Sofia\\new\\index.htm as backslashes need to be escaped.

- Rieekan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top