CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
Referer password script help?



Jan 9, 2001, 5:23 PM

Post #1 of 3 (264 views)
Referer password script help? Can't Post

This script is not working and I cannot figure out why. I have the permissions/chmod set okay, it runs from the prompt. I have not yet moved over the domain name, so I don't know if that is an issue in the referer, but any suggestions you have would be great!

require '';
#print "Content-type: text/html\n\n";
# Convert plus to space
@q = split(/\+/, $ENV{'QUERY_STRING'});
foreach $i (@q)
# Split into key and value.
($key, $val) = split(/=/,$i,2);
# splits on the first =.
# Convert %XX from hex numbers to alphanumeric
$key =~ s/%([A-Fa-f0-9]{2})/pack("c",hex($1))/ge;
$val =~ s/%([A-Fa-f0-9]{2})/pack("c",hex($1))/ge;
# Associate key and value
$q{$key} .= "\0" if (defined($q{$key}));
# \0 is the multiple separator
$q{$key} .= $val;
$referpage = $ENV{'PATH_INFO'};
if ($referpage eq "")
$referpage = $ENV{'HTTP_REFERER'};
$user = $ENV{'REMOTE_USER'};
$user = substr($user,2);
# Pull off "hs" from front to get directoryprint
'Location: /';
print $user; print "\n\n";


Jan 10, 2001, 6:34 AM

Post #2 of 3 (251 views)
Re: Referer password script help? [In reply to] Can't Post

Ewww look at all that ugly code ;)

First off what are you tring to do? Could we have some detials please? and second off. please use


use CGI;
my $obj = new CGI;

print $obj->header();

and if your hard core

#!/usr/bin/perl -wT

use CGI;
use strict;
my $obj = new CGI;

print $obj->header();



Jan 10, 2001, 7:15 AM

Post #3 of 3 (249 views)
Re: Referer password script help? [In reply to] Can't Post

What its supposed to do is the following:

The user accesses this through a link on an HTML page
and is prompted for a username and password. Based on what they enter this script re-directs them to their particular sub folder. thank you!


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives