I am having trouble getting this to work, but maybe it's not possible that's why it's not workin. . .
I have website a with this as the sending script:
#!/usr/bin/perl
require "config.cgi";
print "content-type: text/html\n\n";
open (list, "<$MAILING_LIST") or &NO_OPEN("subscribers.txt missing");if ($flock eq "y") {flock list, 2; }@list=<list>;close(list);
$Emails=0;
foreach $list(@list) {$Emails++;}
print qq~
<body onLoad="document.this.subm
it()">
<form name="this" method="post" action="
http://www.whatever.com/mysub/cgi-bin/mem/tt.cgi">
<input type="hidden" name="email" value="$Emails"></form>
</body>
~;
It works to submit when I load it manually. . . but doesn't seem to work with cron.
Here's what it's submitting to(at a different location):
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;
$value =~ s/\n/ /g;
$form{$name} = $value;
}
$ad = 1;
@bla = split("=",$buffer);
&OPENdb;
&get_members;
$table = "members";
$total = "SELECT COUNT(*) FROM $table WHERE list_verified='yes'";
$tm = $dbh->prepare($total);
$tm->execute;
while ($result = $tm->fetchrow_array) { $total_ver = $result; }
$table = "members";
$total2 = "SELECT COUNT(*) FROM $table WHERE mem_type='Gold' AND want_mail='yes'";
$tm = $dbh->prepare($total2);
$tm->execute;
while ($result = $tm->fetchrow_array) { $total_gold= $result; }
$mailing = $total_ver+$total_gold+$bl
a[1];
$dbh->do("UPDATE admin SET send_to=$mailing WHERE main_a=$ad");
&CLOSEdb;
These are both set to run every minute. . . but only work when manually loaded. . .(from the first script. . .) is there something I can do to make this work?
Start Free Trial