Inserimento key in una function strurl

ciopin

Utente Attivo
26 Mar 2010
59
0
0
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

PHP:
function PostcodeAnywhere_Interactive_RetrieveByPostcodeAndBuilding_v1_10Begin(Key, Postcode, Building, UserName)
   {
      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==1 && 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
               }
         }
   }
 
Discussioni simili
Autore Titolo Forum Risposte Data
S Inserimento API key Singring su CSM Wordpress PHP 0
K Inserimento query Errore 1366 PHP 4
K form Inserimento record mysql PHP 2
Lino80 [Retribuito] Cerco programmatore php per modifica/inserimento funzione/valori da un plugin importer wordpress Offerte e Richieste di Lavoro e/o Collaborazione 0
C inserimento gestionale sotto Word Press WordPress 0
D Inserimento video mp4 HTML e CSS 0
L inserimento form dati multipli ? PHP 0
G Appicazione HTML per inserimento dai in Database Access Microsoft HTML e CSS 0
J Form inserimento dati in database Ajax 1
D modificare questo codice per inserimento in text e non in tabella jQuery 1
R [C#] Automatizzare un inserimento di un Post su un Gruppo Facebook .NET Framework 0
M Aiuto con inserimento immagini WordPress 6
elpirata Impedire inserimento data di oggi e date passate jQuery 39
A Inserimento dati nel database tramite form + altre operazioni PHP 18
W Email conferma inserimento Classic ASP 0
S Inserimento multiplo non richiesto PHP 2
P inserimento icone social tramite html HTML e CSS 1
L form multipla php sql,errore in inserimento MySQL 0
Alex_70 Inserimento dati a cascata PHP 204
T Da xsd a xml ed inserimento dati in excel XML 0
M Problema inserimento parole con apostrofo nel db PHP 5
C [RISOLTO]Inserimento variabile php in input html PHP 20
P Access Inserimento data. MS Access 4
L Inserimento dettagli in una maglia Photoshop 2
S [PHP] email con inserimento dati nel database PHP 23
beatle [Photoshop] problema inserimento immagini Photoshop 1
G [Javascript] Errore inserimento dati Backend Node.js e workbench Javascript 1
B [PHP] Creare PDF dopo inserimento dati form PHP 4
C [PHP] Form con Inserimento dati dalla maschera e un menù a discesa che prende i dati dal db PHP 1
C [PHP] Form inserimento più menù a discesa PHP 9
M [PHP] Problemi su inserimento array nel db PHP 7
gandalf1959 [PHP] Inserimento di più righe non funziona come mi aspetto... PHP 2
E Inserimento dati da PHP in tabella MySQL PHP 5
E Form inserimento dati con JavaScript Javascript 0
D [MS Access] problemi con inserimento campo in una maschera MS Access 6
G inserimento csv in tabella mysql; problema con struttura PHP 11
M [Joomla] Inserimento wow.js in template Joomla 4
K [PHP] Inserimento dati database con postgres PHP 2
K [PHP + MYSQL ] Inserimento dati in database da form dinamico PHP 13
A [PHP] Inserimento url dinamici in pagina html PHP 3
spider81man [PHP] Alert Box per confermare Inserimento o Cancellazione dato. PHP 4
gandalf1959 [MySQL] Inserimento multiplo da form multirighe MySQL 22
A [RISOLTO]Inserimento Immagini da pc a MySql PHP 15
M Inserimento dati checkbox multipli in db da ajax a php PHP 1
S [PHP] inserimento su DB da tabella PHP 29
P [PHP] Problema inserimento nuove chiavi in array PHP 2
paloppa Inserimento data su database MYSQL PHP 2
webimage [PHP] Non inserimento in tabella PHP 19
N [Java] codice per inserimento sql Java 0
T [HTML] inserimento nav HTML e CSS 8

Discussioni simili