Lynda,
Depending on the custom field storing the users' country, the code might look like as follows (example for custom field #1):
// execute on list 1 or 2
if($list=='1' || $list=='2'){
if($user1=='UK'){
// encode for URL
$fname2=urlencode($fname);
$lname2=urlencode($lname);
// set URL - add user to list 3
$url = "http://example.com/mail/signup.php?list=3&email=$email&fname=$fname2&lname=$lname2";
// open URL
$lmp = fopen($url,'r');
fclose($lmp);
}
}
Both lists must be open for this unless we modify signup.php a little and change the code to include a secret password to bypass the closed list...
// execute on list 1 or 2
if($list=='1' || $list=='2'){
if($user1=='UK'){
// encode for URL
$fname2=urlencode($fname);
$lname2=urlencode($lname);
// set URL - add user to list 3
$url = "http://example.com/mail/signup.php?list=3&email=$email&fname=$fname2&lname=$lname2&secret=zJ69Eb4S";
// open URL
$lmp = fopen($url,'r');
fclose($lmp);
}
}
Then in signup.php... change this:
// check closed lists
while(list($key,$list)=each($lists)){
$listopts = getlistopts($list);
if($listopts[0]==1){
$closed[$list] = 1;
if(!in_array($list,$badlists)) $badlists[] = $list;
}
}
reset($lists);
to this:
// check closed lists
while(list($key,$list)=each($lists)){
$listopts = getlistopts($list);
if($listopts[0]==1 && $secret<>'zJ69Eb4S'){
$closed[$list] = 1;
if(!in_array($list,$badlists)) $badlists[] = $list;
}
}
reset($lists);
Unfortunately, unless I were to base the password on the Dailymail password, this change will be overwritten by updates.