Salve ragazzi,

ho trovato un sito UK dove registrandoti ( e pagando) ti danno una user e una key da adoperare e anche gli script da adoperare per l'autocompletamento dati del tuo form se ti serve il postcode in UK. Esempio tu hai il cmapo postcode, l'0utente mette il suo post code e lui in automatico ti popola i campi address2, address2, city, county...una figata insomma. La function è questa ma ( da ignorante come una capra) mi chiedevo dove devo inserire la Key e l'User ( vedo che viene richiesta ma sintatticmante nn saprei come scriverlo) Mi aiutate per favore?

Grazie

Codice PHP:
function PostcodeAnywhere_Interactive_RetrieveByPostcodeAndBuilding_v1_10Begin(KeyPostcodeBuildingUserName)
   {
      var 
scriptTag document.getElementById("PCA38d38252878f434581f85b249661cd94");
      var 
headTag document.getElementsByTagName("head").item(0);
      var 
strUrl "";

      
//Build the url
      
strUrl "http://services.postcodeanywhere.co.uk/PostcodeAnywhere/Interactive/RetrieveByPostcodeAndBuilding/v1.10/json.ws?";
      
strUrl += "&Key=" escape(Key);
      
strUrl += "&Postcode=" escape(Postcode);
      
strUrl += "&Building=" escape(Building);
      
strUrl += "&UserName=" escape(UserName);
      
strUrl += "&CallbackFunction=PostcodeAnywhere_Interactive_RetrieveByPostcodeAndBuilding_v1_10End";

      
//Make the request
      
if (scriptTag
         {
            try
              {
                  
headTag.removeChild(scriptTag);
              }
            catch (
e)
              {
                  
//Ignore
              
}
         }
      
scriptTag document.createElement("script");
      
scriptTag.src strUrl
      scriptTag
.type "text/javascript";
      
scriptTag.id "PCA38d38252878f434581f85b249661cd94";
      
headTag.appendChild(scriptTag);
   }

function 
PostcodeAnywhere_Interactive_RetrieveByPostcodeAndBuilding_v1_10End(response)
   {
      
//Test for an error
      
if (response.length==&& typeof(response[0].Error) != 'undefined')
         {
            
//Show the error message
            
alert(response[0].Description);
         }
      else
         {
            
//Check if there were any items found
            
if (response.length==0)
               {
                  
alert("Sorry, no matching items found");
               }
            else
               {
                  
//PUT YOUR CODE HERE
                  //FYI: The output is an array of key value pairs (e.g. response[0].Udprn), the keys being:
                  //Udprn
                  //Company
                  //Department
                  //Line1
                  //Line2
                  //Line3
                  //Line4
                  //Line5
                  //PostTown
                  //County
                  //Postcode
                  //Mailsort
                  //Barcode
                  //Type
                  //DeliveryPointSuffix
                  //SubBuilding
                  //BuildingName
                  //BuildingNumber
                  //PrimaryStreet
                  //SecondaryStreet
                  //DoubleDependentLocality
                  //DependentLocality
                  //PoBox
                  //CountryName
               
}
         }
   }