If you want to add a "country" field to your email.db file, do the following:
1) Add the following codes in the
sub subscribe routine in the
subscribe.cgi script:
Code:
my $country = $in{'country'};
AFTER the following codes:
Code:
my $name = $in{'name'};
2) Replace the following codes:
Code:
${$users_r}{$email} = $name;
with the following codes:
Code:
${$users_r}{$email}{$country} = $name;
3) Replace the following codes:
Code:
print LIST "$_$db_delim${$users_r}{$_}\n";
with the following codes:
Code:
print LIST "$_$db_delim${$users_r}{$_}$db_delim{$country}\n";
4) Then in the
sub unsubscribe routine, add the following codes:
Code:
my $country = $in{'country'};
AFTER the following codes:
Code:
my $name = $in{'name'};
5) Replace the following codes:
Code:
print LIST "$_$db_delim${$users_r}{$_}\n";
with the following codes:
Code:
print LIST "$_$db_delim${$users_r}{$_}$db_delim{$country}\n";
6) Replace the following codes in the
sub get_users routine:
Code:
(/(.*)$delim(.*)/o) and (${$users_r}{$1} = $2);
with the following codes:
Code:
(/(.*)$delim(.*)/o) and (${$users_r}{$1} = $2) and (/(.*)$delim(.*)/o) and ($($country){$1} = $2);
7) Then in your
email.html template file, add the following codes:
Code:
<select name="country">
<option value="Algeria">Algeria</option>
<option value="United States">United States</option>
</select>
Same thing in the
email_error.html file. You will have to create your own drop-down menu with more choices, of course.
8) Then in the
sub build_email_list in the
db_utils.pl file, edit the following codes:
Code:
my ($name, $email, $output);
to the following:
Code:
my ($name, $email, $country, $output);
9) In the same sub-routine, edit the following codes:
Code:
($email, $name) = split /\Q:\E/;
to the following:
Code:
($email, $name, $country) = split /\Q:\E/;
I don't gaurantee these codes will work...but this is the logic that you need to be using.
Regards,
------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
[This message has been edited by AnthroRules (edited March 27, 2000).]