cancel
Showing results for 
Search instead for 
Did you mean: 
Due to an issue with YouTube, inserting videos in your emails is showing an error. Until they are able to resolve this issue, we recommend using a different video hosting service. We will continue to monitor this outage and update you as we have more information.

Re: Continued Basic Authorization Support

Highlighted
Occasional Contributor

Re: Continued Basic Authorization Support

Hi guys,

need to change the state and country functions with my own since the CC functions don't have state/province for other countries, how can i do that? I always get the error messages below when i tried to fill-out the add_contact.php with the state and country changed to my own functions.

Notice: Undefined index: state_name in C:\wamp\www\cc_class.php on line 517 Call Stack # Time Memory Function Location
10.0007797320{main}( )..\subscribe.php:0
21.45061455760CC_Contact->createContactXML( )..\subscribe.php:179
( ! ) Notice: Undefined index: country_code in C:\wamp\www\cc_class.php on line 518 Call Stack # Time Memory Function Location
10.0007797320{main}( )..\subscribe.php:0
21.45061455760CC_Contact->createContactXML( )..\subscribe.php:179
( ! ) Notice: Undefined index: zip_code in C:\wamp\www\cc_class.php on line 519 Call Stack # Time Memory Function Location
10.0007797320{main}( )..\subscribe.php:0
21.45061455760CC_Contact->createContactXML( )

..\subscribe.php:179

 

 

please help

1 REPLY 1
Advisor

Re: Continued Basic Authorization Support

In the .Net sample project (I might assume there is a similar component in the php sample?) in the app_code folder there is a ConstantContact.cs file. In that file is a listing for US & Canada as well as a country name & code listing.

 

I would suggest porting this to php and adding the additional items.

 

Here are snipts of the top few rows of these sections...

 

        public static DataTable GetStateCollection()
        {
            DataTable provinceTable = new DataTable();
            provinceTable.Columns.Add("Name");
            provinceTable.Columns.Add("Code");
            provinceTable.Columns.Add("CountryCode");

            #region State / Province Names and Codes
            AddProvinceToDataTable(provinceTable, string.Empty, string.Empty, string.Empty);
            AddProvinceToDataTable(provinceTable, "Alabama", "AL", UnitedStatesCountryCode);
            AddProvinceToDataTable(provinceTable, "Alaska", "AK", UnitedStatesCountryCode);
            AddProvinceToDataTable(provinceTable, "Alberta", "AB", CanadaCountryCode);
   ....

        public static DataTable GetCountryCollection()
        {
            DataTable countryTable = new DataTable();
            countryTable.Columns.Add("Name");
            countryTable.Columns.Add("Code");

            #region Country Names and Codes
            AddCountryToDataTable(countryTable, string.Empty, string.Empty);
            AddCountryToDataTable(countryTable, "United States", UnitedStatesCountryCode);
            AddCountryToDataTable(countryTable, "Canada", CanadaCountryCode);
            AddCountryToDataTable(countryTable, "Afghanistan", "af");
            AddCountryToDataTable(countryTable, "Aland Islands", "ax");
            AddCountryToDataTable(countryTable, "Albania", "al");
            AddCountryToDataTable(countryTable, "Algeria", "dz");
            AddCountryToDataTable(countryTable, "American Samoa", "as");
....          

HTH