Pagina 2 di 2 primaprima 1 2
Visualizzazione dei risultati da 11 a 13 su 13
  1. #11
    Utente di HTML.it
    Registrato dal
    Dec 2010
    Messaggi
    3,660
    allora leggi qui oppure(equivalente) qui, il framework è jquery, è il + usato quindi ti consiglio di utilizzare questo cosi trovi anche molti esempi sul web.

    Butta giù qualcosa e se hai difficoltà in qualche punto particolare e non riesci a proseguire posta qui

  2. #12
    Ho rivisto un pò il tutto... IL FILE JAVASCRIPT secondo voi così può cominciare ad andare bene???

    Codice PHP:
    <?php function leggi_cvs ($filepath) { $filepath'studenti.cvs'$rowlength=6$row= array(); if (($handle=fopen("$filepath""r")) !== FALSE) while (($row=fgetcvs($handle)) !== FALSE) { for ($i=0$i<$rowlength$i++ {$rows[]= $row;} } fclose($handle);} return $rows;} function validate_cvs ($rows) { return prev_match ("/^[a-z0-9]{0,16}$/i"//stringhe da 0 a 16 caratteri alfanumeric "/^[a-z0-9]{0,16}$/i", "/^[a-z0-9]{0,16}$/i", "/^[a-z0-9]{0,16}$/i", "/\bBasic\b|\bNormal\b|\bFull\b/", //sole stringhe Basic, Normal, Full "/^(0[1-9]|[12][0-9]|3[01])[-](0[1-9]|1[012])[-](19|20)\d\d$/", //stringhe del tipo dd-mm-aaaa ) echo '{"results":'.json_encode($rows).'}'; php?>;}

    //myjavas.js

    function elabora (str)
    { var xhr= getXMLHttpRequest()
    xhr.open( 'GET', 'mio.php?file='+str+', true);
    xhr.onreadyStateChance==function()
    { if(xhr.readyState==4 && xhr.status==200)

    {var risposta=xhr.responseText;}
    }
    xhr.send(null);}

    function getXMLHttpRequest()
    {...}

    //file index.html
    <HTML>
    <HEAD>
    <SCRIPT type="text/javascript" src="myjavas.js"> </SCRIPT>
    </HEAD>
    <BODY>

    Richiedi dati </p>
    <FORM> Inserisci :
    <INPUT type="TEXT" onclick="elabora()"/>
    </FORM>
    </BODY>
    </HTML>

  3. #13
    Codice PHP:
    <?php function leggi_cvs ($filepath

        
    $filepath'studenti.cvs'
        
    $rowlength=6
        
    $row= array(); 
          if ((
    $handle=fopen("$filepath""r")) !== FALSE
               while ((
    $row=fgetcvs($handle)) !== FALSE
                     { for (
    $i=0$i<$rowlength$i++ {$rows[]= $row;} } 
                                 
    fclose($handle);} 
                                   return 
    $rows;} 

    function 
    validate_cvs ($rows

          return 
    prev_match ("/^[a-z0-9]{0,16}$/i"//stringhe da 0 a 16 caratteri alfanumeric 
                                     
    "/^[a-z0-9]{0,16}$/i"
                                    
    "/^[a-z0-9]{0,16}$/i"
                                    
    "/^[a-z0-9]{0,16}$/i""/bBasicb|bNormalb|bFullb/"
                                   
    //sole stringhe Basic, Normal, Full 
    "/^(0[1-9]|[12][0-9]|3[01])[-](0[1-9]|1[012])[-](19|20)dd$/"//stringhe del tipo dd-mm-aaaa ) 

    $file =addslashed (&_REQUEST['file']

    echo 
    '{"results":'.json_encode($rows).'}'


    php?>;}

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.