i need to prepopulate name/address/email/phone fields, all the while using a special cgi script so that donations can be chosen from a drop down list AND entered in manually. i have the latter part worked out, but i can't get the prepopulated fields to work.
here is the url:
http://partners-charity..../donate_new_address.html
the cgi script i am using is:
#! /usr/bin/perl
sub GetFormData {
if ($ENV{'REQUEST_METHOD'} eq 'GET') {
@pairs = split(/&/, $ENV{'QUERY_STRING'});
} elsif ($ENV{'REQUEST_METHOD'} eq 'POST') {
read(STDIN,$buffer,$ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
if ($ENV{'QUERY_STRING'}) {
@getpairs = split(/&/,$ENV{'QUERY_STRING'});
push (@pairs, @getpairs);}
}
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$name =~ tr/+/ /;
$value =~ tr/+/ /;
$name =~ s/%(..)/pack("C", hex($1))/eg;
$value =~ s/%(..)/pack ("C", hex($1))/eg;
$value =~ s/<!--(.|\n)*-->//g;
if ($in{$name}){$in{$name}.=", $value";}
else{$in{$name} = $value;}
}
}
{&GetFormData}
if ($in{'amount'} eq "texta") {
$in{'amount'} = $in{'texta'};
}
if ($in{'amount'} eq "dropa") {
$in{'amount'} = $in{'dropa'};
}
$browser = "https://www.paypal.com/xclick/business=mgrimes\@worcesterdiocese.org&item_name=$in{'item_name'}&item_number=$in{'item_name'}=&on0=$in{'on0'}&os0=$in{'os0'}&amount=$in{'amount'}&no_shipping=0&no_note=1¤cy_code=USD";
print "Location: $browser\n\n";