Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <title>Arcade Trader</title>
- <link rel="shortcut icon" type="image/png" href="https://upload.wikimedia.org/wikipedia/commons/4/4d/E-megasport.com_-_favicon.png"/>
- <link rel="stylesheet" href="Projet.css" />
- </head>
- <body>
- <fieldset>
- <legend>Se connecter</legend>
- <label>E-mail ou pseudo : </label><input type="text" name="pseudo">
- <label>Mot de passe : </label><input type="text" name="mdp"><br />
- </fieldset>
- <br /><br />
- <h1>Arcade Trader</h1>
- <br /><br />
- <h2 id="accueil">Accueil</h2>
- <h2>Acheter</h2>
- <h2><a href="Annonce.php#annonce" class="elembandeau" title="Vendre">Créer une annonce</a></h2>
- <h2>Aide</h2>
- <br /><br />
- <form action="Projet.php" method="post">
- <select name="categorie" size="1" class="decal">
- <option selected disabled value="disabled">Choisir une catégorie</option>
- <option value="jv">Console et Jeu vidéo</option>
- <option value="figurine">Figurine, Peluche et Jouet</option>
- <option value="film">Film et Animation</option>
- <option value="societe">Jeu de société</option>
- <option value="livre">Livre</option>
- <option value="autre">Autre</option>
- </select>
- <input placeholder="Nom de la ville" type="text" name="ville" />
- <input placeholder="Nom de l'article (ou mot-clé)" type="text" name="recherche" />
- <input type="submit" name="rechercher" value="Rechercher" /><br /><br />
- </form>
- <?php
- if(isset($_POST['recherche'])) {
- $recherche = $_POST['recherche'];
- $ville = $_POST['ville'];
- $categorie = $_POST['categorie'];
- $connect = mysqli_connect("inf-mysql.univ-rouen.fr", "marybtho", "20101999", "marybtho");
- echo mysqli_connect_error();
- $requete = "SELECT * FROM Annonce WHERE localisation LIKE '%$ville%' AND titre LIKE '%$recherche%' AND categorie LIKE '%$categorie%';";
- $res = mysqli_query($connect, $requete);
- echo mysqli_error($connect);
- if(mysqli_num_rows($res) == 0) {
- echo "Aucun résultat trouvé.";
- }
- if(empty($recherche) && empty($ville) && empty($categorie)) {
- echo "Veuillez entrer au moins un critère de recherche.";
- } else {
- while($tab = mysqli_fetch_array($res)) {
- echo "<table>";
- echo "<tr><th>{$tab['titre']}</th></tr>";
- echo "<tr><td>{$tab['description']}</td></tr>";
- echo "</table><br />";
- }
- }
- mysqli_close($connect);
- }
- ?>
- </body>
- </html>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <title>Arcade Trader</title>
- <link rel="shortcut icon" type="image/png" href="https://upload.wikimedia.org/wikipedia/commons/4/4d/E-megasport.com_-_favicon.png"/>
- <link rel="stylesheet" href="Vendre.css" />
- </head>
- <body>
- <?php
- $choix = $_POST['choix'];
- $categorie = $_POST['categorie'];
- $titre = $_POST['titre'];
- $description = $_POST['description'];
- $postal = $_POST['postal'];
- $localisation = $_POST['localisation'];
- $telephone = $_POST['telephone'];
- $email = $_POST['email'];
- $connect = mysqli_connect("inf-mysql.univ-rouen.fr", "marybtho", "20101999", "marybtho");
- echo mysqli_connect_error();
- $requete = "INSERT INTO Annonce VALUES('$titre', '$description', '$categorie', '$postal', '$localisation', '$telephone', '$email')";
- mysqli_query($connect, $requete);
- echo mysqli_error($connect);
- mysqli_close($connect);
- ?>
- <p>
- Votre annonce a bien été prise en compte. Vous pouvez la consulter et la modifier à tout moment.
- </p>
- <p>
- Cliquez <a href="Projet.php"><strong>ici</strong></a> pour revenir à l'accueil.
- </p>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement