Visualizzazione dei risultati da 1 a 7 su 7

Discussione: Gestione checkbox

Visualizzazione discussione

  1. #1
    Utente di HTML.it
    Registrato dal
    Jan 2022
    Messaggi
    5

    Gestione checkbox

    Ciao a tutti
    sono nuova e alle prime armi. Ho creato un modulo e i dati passati dall'utente li devo stampare a video in una tabella, ma ho difficoltà a intabellare correttamente i valori delle checkbox. Qualcuno potrebbe aiutarmi?
    Codice PHP:
    <?php
                $nome
    =$_GET['nome'];
                
    $passwordget=$_GET['password'];
                
    $password=sha1(md5(sha1($passwordget)));
                
    $pattern='/^(?=.*\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[_.\-()?#;:!@])[0-9A-Za-z_.\-()?#;:!@]{8,15}$/';
                
    $argomenti=$_GET['argomenti'];

                if(isset(
    $_GET))
                {
                    if(isset(
    $_GET['nome']))
                    {
                        if(
    $_GET['nome']==null)
                        {
                            print(
    "<h4><center>Il campo 'nome' è vuoto!</center></h4>");    
                        }
                        elseif(!
    preg_match('/^[A-Za-z \'-]+$/i',$nome))
                        {
                            print(
    "<h4><center>Il nome contiene caratteri non ammessi!</center></h4>");
                        }
                        else
                        {
                            print(
    "<h4><center>Nome: OK!</center></h4>");
                        }
                    }
                    if(isset(
    $_GET['password']))
                    {
                        if(
    $_GET['password']==null)
                        {
                            print(
    "<h4><center>Il campo 'password' è vuoto</center></h4>");    
                        }
                        elseif(!
    preg_match($pattern,$_GET['password']))
                        {
                            print(
    "<h4><center>La password non rispetta i requisiti!</center></h4>");
                        }
                        else
                        {
                            print(
    "<h4><center>Password: OK!</center></h4>");
                        }
                    }
                    
                }
                

                if(empty(
    $_GET['argomenti']))
                {
                    print(
    "<h4><center>Nessun argomento selezionato!</center></h4>");
                }


                if(isset(
    $_GET['Invia!']))
                {
                    
                }
                
                
                
    //creo la tabella con le intestazioni TH
                
    print("<table border='1' width='800' cellspacing='0'>");
                print    (
    "<tr>");
                print        (
    "<th height='40'>Nome</th>");
                print        (
    "<th>Password</th>");
                print        (
    "<th>Informazioni su HTML</th>");
                print        (
    "<th>Immagini</th>");
                print        (
    "<th>Collegamenti e URL</th>");
                print        (
    "<th>Oggetti multimediali</th>");
                print        (
    "<th>XHTML versione 1.0</th>");
                print    (
    "</tr>");
                

                if(isset(
    $_GET))
                {
                    print    (
    "<tr>");
                    if(isset(
    $_GET['nome']))
                    {
                        print        (
    "<td height='28'>$nome</td>");
                    }
                    if(isset(
    $_GET['password']))
                    {
                        print        (
    "<td>$password</td>");
                    }
                    foreach(
    $_GET['argomenti'] as $key=>$value)
                    {
                        if(isset(
    $_GET['argomenti']))
                        {
                            if(
    $value=="si")
                            {
                                print(
    $value);
                            }
                            else
                            {
                                print(
    "no");
                            }
                        }    
                        print(
    "<td><center>"$value."</center></td>");
                        exit;
                    }                
                    print    (
    "</tr>");
                }
            
    ?>
    sicuramnte ho commesso altri errori, o se si può far meglio ditemelo.
    Grazie a tutti
    Ultima modifica di ella_n; 17-01-2022 a 15:43

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.