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;
In reply to Re: file input problem
by Anonymous Monk
in thread file input problem
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |