#!/usr/local/bin/perl
$mail_prog = '/usr/sbin/sendmail' ;
&GetFormInput;
$login = $field{'login'} ;	 
$par = $field {'pass'};
	 
	 sub GetFormInput {

	(*fval) = @_ if @_ ;

	local ($buf);
	if ($ENV{'REQUEST_METHOD'} eq 'POST') {
		read(STDIN,$buf,$ENV{'CONTENT_LENGTH'});
	}
	else {
		$buf=$ENV{'QUERY_STRING'};
	}
	if ($buf eq "") {
			return 0 ;
		}
	else {
 		@fval=split(/&/,$buf);
		foreach $i (0 .. $#fval){
			($name,$val)=split (/=/,$fval[$i],2);
			$val=~tr/+/ /;
			$val=~ s/%(..)/pack("c",hex($1))/ge;
			$name=~tr/+/ /;
			$name=~ s/%(..)/pack("c",hex($1))/ge;

			if (!defined($field{$name})) {
				$field{$name}=$val;
			}
			else {
				$field{$name} .= ",$val";
				
			}


		   }
		}
return 1;
}


use Fcntl;
use NDBM_File;



tie %hash, "NDBM_File", "/web/012/wmclicks/public_html/adv/logs/$login", O_RDWR, 0644;
$ps=$hash{pass};
untie %hash;

if ($par eq $ps)
{




tie %hash, "NDBM_File", "/web/012/wmclicks/public_html/adv/logs/$login", O_RDWR, 0644;

$ps=$hash{pass};
$nick = $hash{nick};

untie %hash;

open (FILE,">/web/012/wmclicks/public_html/adv/status/$login.dat");
print FILE "1\n";
close (FILE);


print "Location: http://www.wmclicks.com/cgi-bin/adventer.pl?login=$login&pass=$ps\nURI: http://www.wmclicks.com/cgi-bin/adventer.pl?login=$login&pass=$ps\n\n";





}
