Justin, that works awesome! Thank you so so so much. And for me it is 
definitely and end-all solution as that is all I need. For anyone who wants 
to use Justin's script to create a contact, this is the script I wrote to 
use it:

(Side note: to save a few seconds of frustration, all birthdays and 
anniversaries have to be added with the format "1980-03-93" so that it goes 
Year-Month-Day)




<?php

$firstName="Jdog";
$middleName="Ed";
$lastName="Macdizzle";
$dob="1980-02-04";
$anniversary="2001-01-03";
$emailWork="[email protected]";
$emailPersonal="[email protected]";
$homePhone="832-453-3545";
$mobilePhone="201-532-4583";
$workPhone="654-213-5354";
$workPhone2="789-654-1233";
$fax="555-445-3569";
$company="Jason INC";
$title="Big Boss";
$workCity="houston";
$workAddress="110 Smith St";
$workAddress2="Suite 203";
$workProvince="TX";
$workZipCode="77070";
$workCountry="USA";
$homeCity="Dallas";
$homeAddress="222 Smith";
$homeAddress2="PO BOX 234";
$homeProvince="TX";
$homeZipCode="75287";
$homeCountry="USA";
$website="http://www.jason.com";;
$blog="http://blog.jason.com";;



$contact = array("firstName" => $firstName, "middleName" => $middleName, 
"lastName" => $lastName, "dob" => $dob, "anniversary" => $anniversary, 
"emailWork" => $emailWork, "emailPersonal" => $emailPersonal, "homePhone" => 
$homePhone, "mobilePhone" => $mobilePhone, "workPhone" => $workPhone, 
"workPhone2" => $workPhone2, "fax" => $fax, "company" => $company, "title" 
=> $title, "workCity" => $workCity, "workAddress" => $workAddress, 
"workAddress2" => $workAddress2, "workProvince" => $workProvince, 
"workZipCode" => $workZipCode, "workCountry" => $workCountry, "homeCity" => 
$homeCity, "homeAddress" => $homeAddress, "homeAddress2" => $homeAddress2, 
"homeProvince" => $homeProvince, "homeZipCode" => $homeZipCode, 
"homeCountry" => $homeCountry, "website" => $website, "blog" => $blog);

include_once ('class.Gmail.php');
$gmail = new gmail();
$gmail->setOption('email', '[email protected]');
$gmail->setOption('password', 'password');
$gmail->login();
       
$results = $gmail->contact($contact, 'add');


?>





P.S. In order for the website and blog of the user to be added, you just 
have to add these few lines to the contact function inside of the 
class.Gmail.php file that Justin so kindly provided:




//    WEBSITE
if(!empty($contact['website'])) {
$webber = $doc->createElement('gContact:website');
$webber->setAttribute('rel', 'home');
$webber->setAttribute('href', $contact['website']);   

$entry->appendChild($webber);
}

//    BLOG
if(!empty($contact['website'])) {
$webberB = $doc->createElement('gContact:website');
$webberB->setAttribute('rel', 'blog');
$webberB->setAttribute('href', $contact['blog']);   

$entry->appendChild($webberB);
}





//Thanks again Justin!

-- 
You received this message because you are subscribed to the Google
Groups "Google Contacts, Shared Contacts and User Profiles APIs" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://code.google.com/apis/contacts/community/forum.html

Reply via email to