#!/usr/local/bin/perl
$mail_prog = '/usr/sbin/sendmail' ;
$htp = 'http://wm-clicks.net' ;
&GetFormInput;
$login = $field{'login'};
$summ = $field{'summ'};

	 

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;
}




open (FILE,">>/web/012/wmclicks/public_html/admin/sb.dat");
print FILE "$login,$summ\n";
close (FILE);

print "Location: https://w3s.webmoney.ru/asp/choice_payment.asp?P=R999245897113&A=$summ\nURI: https://w3s.webmoney.ru/asp/choice_payment.asp?P=R999245897113&A=$summ\n\n";

