File "table01.php"

Full Path: /home/analogde/www/Python/Monsta-FTP-master/affichahe _expand_collpase_tableau/table01.php
File size: 1.89 KB
MIME-type: text/html
Charset: utf-8

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Lien dynamique généré en PHP</title>
    <style>
        table {
            border-collapse: collapse;
            width: 50%;
            margin: 20px auto;
        }
        th, td {
            border: 1px solid #ccc;
            padding: 10px;
            text-align: center;
        }
        th {
            background-color: #f4f4f4;
        }
        a {
            color: blue; /* Couleur du lien */
            text-decoration: none; /* Suppression du soulignement */
        }
        a:hover {
            text-decoration: underline; /* Soulignement au survol */
        }
    </style>
</head>
<body>
    <h2>Tableau avec liens générés en PHP</h2>

    <table>
        <thead>
            <tr>
                <th>Nom</th>
                <th>Lien</th>
            </tr>
        </thead>
        <tbody>
            <?php
            // Tableau d'exemples de fichiers
            $files = [
                "fichier1" => "Fichier 1",
                "fichier2" => "Fichier 2",
                "fichier3" => "Fichier 3"
            ];

            // Parcourir les fichiers pour générer les lignes du tableau
            foreach ($files as $key => $name) {
                echo "<tr>";
                echo "<td>$name</td>";

                $zzz = "alpha";

                echo "<td><a href='?file=" . urlencode($zzz) . "'>Voir $name</a></td>";
                echo "</tr>";
            }
            ?>
        </tbody>
    </table>

    <?php
    // Vérifier si une valeur a été envoyée via GET
    if (isset($_GET['file'])) {
        $file = htmlspecialchars($_GET['file']); // Sécuriser la valeur pour éviter les injections
        echo "<p>Vous avez cliqué sur le lien pour le fichier : <strong>$file</strong></p>";
    }
    ?>
</body>
</html>