
TheGame+
Deleted
May 24, 2000, 1:17 PM
Post #4 of 8
(700 views)
|
Your script is seriously garbled - I can only hope this is just a bad cut & paste, and not the original script... Anyway, assuming the users, passes and URLs are in the file 'zach', and that that file happens to be located in the current directory where the script is executed (who knows, you might get lucky), here's a slightly better script : <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser); $username = param('username'); $password = param('password'); $url = "http://some.default.url/if_they're_wong/"; open(DATA,"<zach") | | die "Sorry, I can't open file 'zach' - $!\n"; while (<DATA> ) { chomp; next if /^$/; # skip empty lines ($user, $pwd, $location) = split(/::/); if (($user eq $username) && ($pwd eq $password)) { $url = $location; last; } } close(DATA); print redirect($url); </pre><HR></BLOCKQUOTE> An absolute path to your 'zach' file would help if you get the "Sorry, I can't open..." error.
|