PHP: Exemple d’un formulaire de recherche

Author:

 formulaire
Download

<html>
<head>
 
</head>
<body>
<?php
// Créer un formulaire de recherche
$self = htmlentities($_SERVER['PHP_SELF']);
if (!isset($_GET["recherche"]))
{
 
    echo ('
<form action="'.$self.'" method="GET">
        <label>Recherche:
<input type="text" name="recherche" /></label>
<input type="submit" value="Rechercher" />
    </form>
 
');
}
else
{
    $recherche = htmlentities($_GET["recherche"]);
    echo "Vous avez taper: <strong>$recherche</string>";
}
?>
</body>
</html>

Leave a Reply

Your email address will not be published. Required fields are marked *


three × 7 =