Navigazione

    Privacy - Termini e condizioni
    © 2020 Search On Media Group S.r.l.
    • Registrati
    • Accedi
    • CATEGORIES
    • Discussioni
    • Non letti
    • Recenti
    • Hashtags
    • Popolare
    • Utenti
    • Stream
    • Interest
    • Categories
    1. Home
    2. spettinato
    3. Post
    S

    spettinato

    @spettinato

    • Profilo
    • Chi segue 0
    • Da chi è seguito 0
    • Discussioni 1
    • Post 6
    • Migliore 0
    • Gruppi 0
    Iscrizione Ultimo Accesso
    Età 18
    0
    Reputazione
    6
    Post
    0
    Visite al profilo
    0
    Da chi è seguito
    0
    Chi segue
    User Newbie

    Post creati da spettinato

    • RE: Passaggio array da javascript a php

      Mi sa che però mi sono spiegato male io. Non riesco a far arrivare niente alla pagina php proprio. Dal form hidden non passa nulla alla pagina php. Ti incollo qui la pagina html e js.

      <script language=javascript>
      scriptAr = new Array();
      scriptAr[0] = "one";
      scriptAr[1] = "two";
      scriptAr[2] = "three";
      //alert(scriptAr.toString());
      </script>
      
      
      <?
      //Step 2:
      //Now we will create a hidden form field as follows
      ?>
      <form action="phpArrayTest.php" method=post name=test onSubmit="setValue()">
      <input name="arv" type=hidden>
      <input type="submit">
      </form>
      
       
      <?
      //Here what we have done is, when the submit is called we first do some work ("onSubmit=setValue()") by using the onSubmit method.
      //The onSubmit method will invoke setValue() function defined by us. After that the action will take place and stringTokens.php will be called.
      //Step 3:
      //Here we define the setValue method. The method will convert the array periviously defined in to a string and then set it to the hidden field.
      ?>
      
      <script language=javascript> 
      function setValue()
      {
      var arv = scriptAr.toString();
      // This line converts js array to String document.test.arv.value=arv;
      // This sets the string to the hidden form field. }
      </script>
      
      

      Dove sbaglio? come faccio a far passare quel vettore al php?
      Ancora grazie.

      postato in Coding
      S
      spettinato
    • RE: Passaggio array da javascript a php

      Ho fatto tutto quanto, poi ho fatto una pagina php e ci ho messo ```
      print_r($_POST)

      così da vedere tutto quello che viene spedito su post.
      Eccone il risultato:
      

      Array ( [arv] => )

      
      Dove sbaglio? Grazie un sacco Claudio :x
      postato in Coding
      S
      spettinato
    • RE: Passaggio array da javascript a php

      Ciao Claudio,
      grazie per la risposta. l topic che mi hai passato è molto interessante, ma il punto per me resta lo stesso.
      "Step 4:
      In the php file the string will be split back into array."

      Come faccio da php a leggere una variabile del javascript?

      postato in Coding
      S
      spettinato
    • RE: Passaggio array da javascript a php

      Scusate se riesumo questa discussione, ma ho lo stesso problema, vorrei passare un vettore da javascript a php, con metodo post, ma non ho capito come intendeva farlo ClaudioWeb.
      Qualcuno ha uno scriptino anche semplice per farmi capire? Conosco il php ma poco di javascript, e non ne sto uscendeo molto bene.
      Grazie.

      postato in Coding
      S
      spettinato
    • RE: Un sito bannato da AdSense puo affittare lo spazio

      Ecco, ma come si fa ad avere una seconda possibilità? qualcuno mi spiega il procedimento? eventualmente anche per mail a [email][email protected][/email]. Grazie.

      postato in Google Adsense
      S
      spettinato
    • Arrivato!

      Grazie del benvenuto, e sono arrivato anche io, per lo più per sfruttare le vostre conoscenze legate all'utilizzo della partita iva 😉

      postato in Presentati alla Community
      S
      spettinato