Pagina 2 di 3 primaprima 1 2 3 ultimoultimo
Visualizzazione dei risultati da 11 a 20 su 21
  1. #11
    codice:
    <form action="postconvocazione.php" method="post">
    <B>Ora di ritrovo</B></td>
               <input name="time" size=5 value="">
    
    <B>Luogo di ritrovo</B>
               <input name="place" size=15 value="">
    
    <B>Guardalinee</B>
              <select name="guarda" size="1"><option value=""></option>
                    <?php $giocatori = array_diff(scandir("$path"), array('pic', '..', '.'));
                        foreach ($giocatori as $giocatore) {
                            $giocatore_vis = $giocatore; $giocatore_vis = @str_replace("-", " ", $giocatore_vis);
                            $giocatore_vis = @str_replace(".php", "", $giocatore_vis);
                            $f = file_get_contents("$path/$giocatore"); echo "<option value=\"$giocatore\" > $giocatore_vis </option>"; } ?>
                    </select>
    
             <B>Giocatore</B></td>
              <select name="gioc1" size="1"><option value=""></option>
            <?php $giocatori = array_diff(scandir("$path"), array('pic', '..', '.'));
            foreach ($giocatori as $giocatore) {
                $giocatore_vis = $giocatore; $giocatore_vis = @str_replace("-", " ", $giocatore_vis);
                $giocatore_vis = @str_replace(".php", "", $giocatore_vis);
                $f = file_get_contents("$path/$giocatore"); echo "<option value=\"$giocatore\" > $giocatore_vis </option>"; } ?>
         </select>
    
             <B>Giocatore</B></td>
              <select name="gioc2" size="1"><option value=""></option>
            <?php $giocatori = array_diff(scandir("$path"), array('pic', '..', '.'));
            foreach ($giocatori as $giocatore) {
                $giocatore_vis = $giocatore; $giocatore_vis = @str_replace("-", " ", $giocatore_vis);
                $giocatore_vis = @str_replace(".php", "", $giocatore_vis);
                $f = file_get_contents("$path/$giocatore"); echo "<option value=\"$giocatore\" > $giocatore_vis </option>"; } ?>
         </select>
    
             <B>Giocatore</B></td>
              <select name="gioc3" size="1"><option value=""></option>
            <?php $giocatori = array_diff(scandir("$path"), array('pic', '..', '.'));
            foreach ($giocatori as $giocatore) {
                $giocatore_vis = $giocatore; $giocatore_vis = @str_replace("-", " ", $giocatore_vis);
                $giocatore_vis = @str_replace(".php", "", $giocatore_vis);
                $f = file_get_contents("$path/$giocatore"); echo "<option value=\"$giocatore\" > $giocatore_vis </option>"; } ?>
         </select>
    
             <B>Giocatore</B></td>
              <select name="gioc4" size="1"><option value=""></option>
            <?php $giocatori = array_diff(scandir("$path"), array('pic', '..', '.'));
            foreach ($giocatori as $giocatore) {
                $giocatore_vis = $giocatore; $giocatore_vis = @str_replace("-", " ", $giocatore_vis);
                $giocatore_vis = @str_replace(".php", "", $giocatore_vis);
                $f = file_get_contents("$path/$giocatore"); echo "<option value=\"$giocatore\" > $giocatore_vis </option>"; } ?>
         </select>
    
             <B>Giocatore</B></td>
              <select name="gioc5" size="1"><option value=""></option>
            <?php $giocatori = array_diff(scandir("$path"), array('pic', '..', '.'));
            foreach ($giocatori as $giocatore) {
                $giocatore_vis = $giocatore; $giocatore_vis = @str_replace("-", " ", $giocatore_vis);
                $giocatore_vis = @str_replace(".php", "", $giocatore_vis);
                $f = file_get_contents("$path/$giocatore"); echo "<option value=\"$giocatore\" > $giocatore_vis </option>"; } ?>
         </select>
    
    e via di seguito fino a gioc20...

    postconvocazione.php

    Codice PHP:
    <?php

        
    //Sostituisco le lettere accentate con le relativa entità html
        
    function cambia_acc($dato){
            
    $dato = @str_replace("\'""'"$dato);
            
    $dato = @str_replace('\"''"'$dato);
            return 
    $dato;
        }
        
        
    // Definizione dei path
        
    $path0 'public/tornei';


        
    // Collegamento tra variabile e input
        
    $time $_POST['time'];
        
    $place = @htmlspecialchars($place,ENT_QUOTES);
        
    $place cambia_acc($_POST['place']);
        
        
    $gioc1 $_POST['gioc1'];
        
    $gioc2 $_POST['gioc2'];
        
    $gioc3 $_POST['gioc3'];
        
    $gioc4 $_POST['gioc4'];
        
    $gioc5 $_POST['gioc5'];
        
    $gioc6 $_POST['gioc6'];
        
    $gioc7 $_POST['gioc7'];
        
    $gioc8 $_POST['gioc8'];
        
    $gioc9 $_POST['gioc9'];
        
    $gioc10 $_POST['gioc10'];
        
    $gioc11 $_POST['gioc11'];
        
    $gioc12 $_POST['gioc12'];
        
    $gioc13 $_POST['gioc13'];
        
    $gioc14 $_POST['gioc14'];
        
    $gioc15 $_POST['gioc15'];
        
    $gioc16 $_POST['gioc16'];
        
    $gioc17 $_POST['gioc17'];
        
    $gioc18 $_POST['gioc18'];
        
    $gioc19 $_POST['gioc19'];
        
    $gioc20 $_POST['gioc20'];
        
        
    $guarda $_POST['guarda'];
        
    $note $_POST['note'];
        
        
    $path $_POST['path'];
        
    $path "$path0/$path";
        
        
    $type $_POST['type'];
        
    $nome $_POST['nome'];
        
        
    // Scrivo le informazioni sul file di testo
        
    $f = @file_get_contents("$path");
        
    $file = @explode("|"$f);
        
        
    print_r($f); print_r($file);  
        
        
    // Dati partita
        
    $file[0];
        
    $file[1];    
        
    $file[2];    
        
    $file[3];    
        
    $file[4];    
        
    $file[5];    
        
    $file[6];    
        
    $file[7];    
        
    $file[8];    
        
    $file[9];    
        
    $file[10];    
        
        
    // Convocati
        
    $file[11] = $gioc1//
        
    $file[12] = $gioc2//
        
    $file[13] = $gioc3//
        
    $file[14] = $gioc4//
        
    $file[15] = $gioc5;
        
    $file[16] = $gioc6;
        
    $file[17] = $gioc7;
        
    $file[18] = $gioc8;
        
    $file[19] = $gioc9;
        
    $file[20] = $gioc10;
        
    $file[21] = $gioc11;
        
    $file[22] = $gioc12;
        
    $file[23] = $gioc13;
        
    $file[24] = $gioc14;
        
    $file[25] = $gioc15;
        
    $file[26] = $gioc16//
        
    $file[27] = $gioc17;
        
    $file[28] = $gioc18;
        
    $file[29] = $gioc19;
        
    $file[30] = $gioc20;
        
        
    $file[41] = $time;
        
    $file[42] = $place;
        
    $file[43] = $guarda;
        
    $file[44] = $note;
        
        
    $file[45];
            
        @
    file_put_contents($path"<?php/*|$file[1]|$file[2]|$file[3]|$file[4]|$file[5]|$file[6]|$file[7]|$file[8]|$file[9]|$file[10]|$file[11]|$file[12]|$file[13]|$file[14]|$file[15]|$file[16]|$file[17]|$file[18]|$file[19]|$file[20]|$file[21]|$file[22]|$file[23]|$file[24]|$file[25]|$file[26]|$file[27]|$file[28]|$file[29]|$file[30]|||||||||||$file[41]|$file[42]|$file[43]|$file[44]|*/?>");
            
        @
    fclose($path);
        
        echo 
    "
    <CENTER></br></br></br></br></br></br>
    <font color=\"#e4dece\"> Convocazioni inserite correttamente. </font></br></br>
    <h4><a href=\"/gestisci.php?page=gestisci_partite&t=
    $type&n=$nome\"> Torna </a></h4>
    </CENTER> "
    ;


    ?>
    Ultima modifica di Luca Crippa; 13-10-2014 a 15:59

  2. #12

  3. #13
    come dovrebbe essere il file modificato dopo le convocazioni:


    <?php/*|Stella_Rossa-Cornate|OMCC03-Concorezzo|3|2|2014|10|04||16:45|15:30|Brambilla-Luca.php|Alberto-Cambiaghi.php|Crippa-Luca.php|Alberto-DeBernardi.php|Brambillasca-Marco.php|Cantù-Mauro.php|Mandelli-Daniele.php|Colombo-Pietro.php|Durosini-Federico.php|Formenti-Lorenzo.php|De-Salvia-Lorenzo.php|Sabbioni-Matteo.php|Camboni-Stefano.php|Colombo-Luca.php|Fumagalli-Gerardo.php|Carzaniga-Carlo.php|Colombo-Stefano.php|Limonta-Andrea.php|Limonta-Daniele.php|Viganò-Francesco.php|||||||||||15:05|Via Verdi||*/?>



    come invece è:

    <?php/*|Stella_Rossa-Cornate|OMCC03-Concorezzo|3|2|2014|10|04||16:45|15:30|Brambilla-Luca.php|Alberto-Cambiaghi.php|||Brambillasca-Marco.php|Cantù-Mauro.php|Mandelli-Daniele.php|Colombo-Pietro.php|Durosini-Federico.php|Formenti-Lorenzo.php|De-Salvia-Lorenzo.php|Sabbioni-Matteo.php|Camboni-Stefano.php|Colombo-Luca.php|Fumagalli-Gerardo.php|Carzaniga-Carlo.php|Colombo-Stefano.php|Limonta-Andrea.php|Limonta-Daniele.php|Viganò-Francesco.php|||||||||||15:05|Via Verdi||*/?>

  4. #14
    Stai richiamando $_POST['path'] e $_POST['time'] ma nel primo codice non trovo né l'uno né l'altro.

    EDIT: come non detto, vedo che funzionano quindi ci saranno

    PS: Una dritta: Anziché usare 'gioc1', 'gioc2' ecc. come nomi dei campi select, usa 'gioc[]' per tutti, così avrai $_POST['gioc'] un array che li contiene tutti (ti semplifica la vita almeno 10 volte!)

  5. #15
    Sì, ci sono in alto, nel primo codice:

    codice:
    <? 		$type = $_GET['t'];
    	$nome = $_GET['n'];
    	$part = $_GET['p'];
    	
    	$path = "public/rosaattiva";
    	
    	$type2 = $type;
    	$nome2 = $nome;
    	$part2 = $part;
    	
    	$type2 = @ucfirst($type2);
    	$nome2 = @str_replace("!a!", " ", $nome2);
    	$nome2 = @str_replace("_", " ", $nome2);
    	$part2 = @str_replace("_", " ", $part2);
    	$part2 = @str_replace("-", " ", $part2);
    	$part2 = @str_replace(".php", "", $part2);
    	$part2 = @str_replace("vs", "<b>vs</b>", $part2);
    ?>

  6. #16
    PS: Una dritta: Anziché usare 'gioc1', 'gioc2' ecc. come nomi dei campi select, usa 'gioc[]' per tutti, così avrai $_POST['gioc'] un array che li contiene tutti (ti semplifica la vita almeno 10 volte!)

    PS 2: Hai mai sentito parlare dell'istruzione for ? Non vedo il problema ma sono quasi sicuro che quelli che non ti escono è perché li hai scritti diversi dagli altri, mentre se avessi usato il for non ci sarebbe questo dubbio

  7. #17
    Sì certo,
    ma nella pagina del form ho i vari menu a tendina dove posso impostare il giocatore (tra quelli registrati nel sito), dal numero 1 al 20. In che senso scritti diversi?

  8. #18
    I numeri gioc1 - gioc20 sono scritti tutti giusti.

  9. #19

  10. #20
    Utente di HTML.it L'avatar di boots
    Registrato dal
    Oct 2012
    Messaggi
    1,626
    Quote Originariamente inviata da Luca Crippa Visualizza il messaggio
    Array ( [0] => OMCC03-Concorezzo [2] => SantEustorgio_Leoni-Arcore [3] => - [4] => - [5] => 2014 [6] => 10 [7] => 11 [8] => Geschello [9] => 13:45 [10] => 12:45 [11] => Piazza-Luca.php [12] => [13] => [14] => Cantu-Mauro.php [15] => Colombo-Pietro.php [16] => Durosini-Federico.php [17] => Formenti-Lorenzo.php [18] => Preziosa-Alberto.php [19] => De-Salvia-Lorenzo.php [20] => Spreafico-Marco.php [21] => Fusilli-Stefano.php [22] => Fumagalli-Gerardo.php [23] => Brambilla-Luca.php [24] => Colombo-Stefano.php [25] => Limonta-Andrea.php [26] => Limonta-Daniele.php [27] => [28] => [29] => [30] => [31] => [32] => [33] => [34] => [35] => [36] => [37] => [38] => [39] => [40] => [41] => 12:45 [42] => Geschello [43] => [44] => [45] => */?> )
    E' il print_r($_POST) ? nel qual caso 12 e 13 son vuoti. Io ricontrollerei il form

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 © 2026 vBulletin Solutions, Inc. All rights reserved.