Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $annuaire[0]["Nom"] = "Lefevre";
- $annuaire[0]["Prenom"] = "Jean-Pierre";
- $annuaire[0]["Adresse"] = "12 rue de Paris";
- $annuaire[0]["Tel"] = "0142216132";
- $annuaire[1]["Nom"] = "Jego";
- $annuaire[1]["Prenom"] = "Irène";
- $annuaire[1]["Adresse"] = "1 rue du Palais";
- $annuaire[1]["Tel"] = "0386060708";
- echo "<table>";
- echo "<tr>";
- echo "<td><b>Nom</b></td>";
- echo "<td><b>Prénom</b></td>";
- echo "<td><b>Adresse</b></td>";
- echo "<td><b>Téléphone</b></td>";
- echo "</tr>";
- foreach($annuaire as $ligne) {
- echo "<tr>";
- echo "<td>".$ligne["Nom"]."</td>";
- echo "<td>".$ligne["Prenom"]."</td>";
- echo "<td>".$ligne["Adresse"]."</td>";
- echo "<td>".$ligne["Tel"]."</td>";
- echo "</tr>";
- }
- echo "</table>";
- echo "<br><br><br>";
- echo "<form
- Name='SearchBox'
- Action='TP1_SearchResult.php'
- Method='post'
- >";
- echo "Rechercher : ";
- echo "<input name='name'>";
- echo " <button type='submit'>Rechercher</button>";
- echo "</form>";
- ?>
- <?php
- $annuaire[0]["Nom"] = "Lefevre";
- $annuaire[0]["Prenom"] = "Jean-Pierre";
- $annuaire[0]["Adresse"] = "12 rue de Paris";
- $annuaire[0]["Tel"] = "0142216132";
- $annuaire[1]["Nom"] = "Jego";
- $annuaire[1]["Prenom"] = "Irène";
- $annuaire[1]["Adresse"] = "1 rue du Palais";
- $annuaire[1]["Tel"] = "0386060708";
- echo "<table>";
- echo "<tr>";
- echo "<td><b>Nom</b></td>";
- echo "<td><b>Prénom</b></td>";
- echo "<td><b>Adresse</b></td>";
- echo "<td><b>Téléphone</b></td>";
- echo "</tr>";
- foreach($annuaire as $ligne) {
- if (strpos($ligne["Nom"], $_REQUEST["name"]) !== false) {
- echo "<tr>";
- echo "<td>".$ligne["Nom"]."</td>";
- echo "<td>".$ligne["Prenom"]."</td>";
- echo "<td>".$ligne["Adresse"]."</td>";
- echo "<td>".$ligne["Tel"]."</td>";
- echo "</tr>";
- }
- }
- echo "</table>";
- echo "<br><br><br>";
- echo "<a href='TP1.php'>Retour</a>";
- <?php
- $annuaire[0]["Nom"] = "Lefevre";
- $annuaire[0]["Prenom"] = "Jean-Pierre";
- $annuaire[0]["Adresse"] = "12 rue de Paris";
- $annuaire[0]["Tel"] = "0142216132";
- $annuaire[1]["Nom"] = "Jego";
- $annuaire[1]["Prenom"] = "Irène";
- $annuaire[1]["Adresse"] = "1 rue du Palais";
- $annuaire[1]["Tel"] = "0386060708";
- echo "<table>";
- echo "<tr>";
- echo "<td><b>Nom</b></td>";
- echo "<td><b>Prénom</b></td>";
- echo "<td><b>Adresse</b></td>";
- echo "<td><b>Téléphone</b></td>";
- echo "</tr>";
- foreach($annuaire as $ligne) {
- if (strpos($ligne["Nom"], $_REQUEST["name"]) !== false) {
- echo "<tr>";
- echo "<td>".$ligne["Nom"]."</td>";
- echo "<td>".$ligne["Prenom"]."</td>";
- echo "<td>".$ligne["Adresse"]."</td>";
- echo "<td>".$ligne["Tel"]."</td>";
- echo "</tr>";
- }
- }
- echo "</table>";
- echo "<br><br><br>";
- echo "<a href='TP1.php'>Retour</a>";
- <?php
- $Host = "localhost"; $user = "root"; $password = "";
- $base = "coursphp";
- $table = "TP1";
- $Connexion = mysqli_connect($Host, $user, $password) or die("Connexion");
- mysqli_select_db($Connexion, $base) or die("Select Base");
- $query = "SELECT * FROM $table";
- $result = mysqli_query($Connexion, $query) or die("Ln9");
- echo "<table>";
- echo "<tr>";
- echo "<td><b>Nom</b></td>";
- echo "<td><b>Prénom</b></td>";
- echo "<td><b>Adresse</b></td>";
- echo "<td><b>Téléphone</b></td>";
- echo "</tr>";
- while ($ligne=mysqli_fetch_array($result)) {
- echo "<tr>";
- echo "<td>".$ligne["Nom"]."</td>";
- echo "<td>".$ligne["Prenom"]."</td>";
- echo "<td>".$ligne["Adresse"]."</td>";
- echo "<td>".$ligne["Tel"]."</td>";
- echo "</tr>";
- }
- echo "</table>";
- echo "<br><br><br>";
- echo "<form
- Name='SearchBox'
- Action='TP1_SearchResult.php'
- Method='post'
- >";
- echo "Rechercher : ";
- echo "<input name='name'>";
- echo " <button type='submit'>Rechercher</button>";
- echo "</form>";
- ?>
- <?php
- $Host = "localhost"; $user = "root"; $password = "";
- $base = "coursphp";
- $table = "TP1";
- $Connexion = mysqli_connect($Host, $user, $password) or die("Connexion");
- mysqli_select_db($Connexion, $base) or die("Select Base");
- $query = "SELECT * FROM $table";
- $result = mysqli_query($Connexion, $query) or die("Ln9");
- echo "<table>";
- echo "<tr>";
- echo "<td><b>Nom</b></td>";
- echo "<td><b>Prénom</b></td>";
- echo "<td><b>Adresse</b></td>";
- echo "<td><b>Téléphone</b></td>";
- echo "</tr>";
- while ($ligne=mysqli_fetch_array($result)) {
- if (strpos($ligne["Nom"], $_REQUEST["name"]) !== false) {
- echo "<tr>";
- echo "<td>".$ligne["Nom"]."</td>";
- echo "<td>".$ligne["Prenom"]."</td>";
- echo "<td>".$ligne["Adresse"]."</td>";
- echo "<td>".$ligne["Tel"]."</td>";
- echo "</tr>";
- }
- }
- echo "</table>";
- echo "<br><br><br>";
- echo "<a href='TP1.php'>Retour</a>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement