in reply to file input problem
This is the latest update I have done... it may be working, or I may have been in the middle of something... but this is the entire script.#!/usr/bin/perl use CGI::Cookie; print "Content-type:text/html\n"; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } $log = $FORM{username}; $pass = $FORM{password}; open (FILE, "users"); while(<FILE>){ $fl = <FILE>; chomp $fl; ($name, $value) = split(/,/, $fl); $refpass = $value; $reflog = $name; close FILE; if ($pass eq $refpass && $log eq $reflog) { print "Set-Cookie: usernamefromzybak=$refpass\n\n"; print <<EndHTML; <html><head><title>testing</title></head> <body> welcome , $FORM{username} <br /> to 171:4's headquarters!<br /> <a href="hq.cgi">Enter now!</a> </body></html> EndHTML close FILE; } } close FILE;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: file input problem
by merlyn (Sage) on Apr 25, 2001 at 20:00 UTC | |
|
Re: Re: file input problem
by thabenksta (Pilgrim) on Apr 25, 2001 at 20:20 UTC | |
by Anonymous Monk on Apr 25, 2001 at 22:56 UTC | |
|
Re: Re: file input problem
by coolmichael (Deacon) on Apr 26, 2001 at 05:04 UTC | |
|
Re: Re: file input problem
by Anonymous Monk on Apr 25, 2001 at 20:12 UTC | |
by diarmuid (Beadle) on Apr 26, 2001 at 17:16 UTC |