As I mention before this is our old sample script and I was surprised to see that there was a large area of code that was not working at all.
I have a resolution with only a few code changes outlined below:
In the Contact.php page, locate the SetContactInfo function and change it to the following:
public function SetContactInfo($home_num, $work_num, $addr_1, $addr_2, $addr_3, $city, $state, $country, $postal_code, $sub_postal) {
$this->home_number=$home_num;
$this->work_number=$work_num;
$this->address_line_1=$addr_1;
$this->address_line_2=$addr_2;
$this->address_line_3=$addr_3;
$this->city_name=$city;
$this->state_code=$state;
$this->country_code=$country;
$this->zip_code=$postal_code;
$this->sub_zip_code=$sub_postal;
}
This function will now process the remaining contact details including the city and phone numbers.
Next you will want to locate the section in the AddAContact.php file that contains the declarations of the contact details. It begins with the following code:
$ct = new Contact(CC_USERNAME,CC_PASSWORD,CC_APIKEY,LOGFILE);
$email = $emailCom;
$list_name = urlencode(strip_tags($_REQUEST));
...
and add the following code:
$home_num= urlencode(strip_tags($_REQUEST));
$work_num= urlencode(strip_tags($_REQUEST));
$addr_1= urlencode(strip_tags($_REQUEST));
$addr_2= urlencode(strip_tags($_REQUEST));
$addr_3= urlencode(strip_tags($_REQUEST));
$city= urlencode(strip_tags($_REQUEST));
$state= urlencode(strip_tags($_REQUEST));
$country= urlencode(strip_tags($_REQUEST));
$postal_code= urlencode(strip_tags($_REQUEST));
$sub_postal= urlencode(strip_tags($_REQUEST));
This will now look for the preceding fields being submited from the form. Notice that is contains the city and home_num fields.
Next look slightly lower in the code and locate the following line:
$ct->SetPrimaryInfo($email, $list_name, $first_name, $last_name, $middle_name, $company_name, $job_title);
Now add the following call directly below that:
$ct->SetContactInfo($home_num, $work_num, $addr_1, $addr_2, $addr_3, $city, $state, $country, $postal_code, $sub_postal);
Finally you will need to add the desired fields to the form that you are using to request the data. For instance, the Home Phone Number field would look like so:
<input type="text" name="home_num" maxLength="100" />
This is using the names that are described in the REQUEST variables:
$home_num= urlencode(strip_tags($_REQUEST));
I hope this helps you out. This sample was seriously lacking functionality due to a few big chunks of missing code.
Best of luck.
... View more