i have the following cgi called in status_url which is working.



#!/usr/bin/perl -w 

use strict; 





-- original code - working 



#!/usr/local/bin/perl  



if ($ENV{"REQUEST_METHOD"} eq 'GET') { $buffer = $ENV{'QUERY_STRING'}; }

else { 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;

} 



$database='input.db';

open (DATABASE1,">>$database");

print DATABASE1 
"$FORM{'refer'}|$FORM{'PAYMENT_BATCH_NUM'}|$FORM{'PAYER_ACCOUNT'}|$FORM{'PAYMENT_AMOUNT'}\n";

close (DATABASE1);



----- 



but but when i changed the code to (to add the date):-





--> this is not working.



#!/usr/local/bin/perl -w 

use strict; 





if ($ENV{"REQUEST_METHOD"} eq 'GET') { $buffer = $ENV{'QUERY_STRING'}; }

else { 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;

} 





my ($day,$month,$year) = (localtime)[3..5]; 

$day = sprintf("%02d",$day); 

$month++; 

$month = sprintf("%02d",$month); 

$year %= 100; 

$year = sprintf("%02d",$year); 

my $date = $day . '-' . $month . '-' . $year; 



print "$date\n"; 



$database='input.db';

open (DATABASE1,">>$database");

print DATABASE1 
"$FORM{'refer'}|$FORM{'PAYMENT_BATCH_NUM'}|$FORM{'PAYER_ACCOUNT'}|$FORM{'PAYMENT_AMOUNT'}\n";

close (DATABASE1);





--- what can i do to capture the date of spend and put it in 'input.db' ?

Sign up for your FREE E-MAIL account @ WHATMAIL:

http://www.whatmail.com

---
You are currently subscribed to e-gold-tech as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to