diff --git a/result_search.php b/result_search.php index 5e6edd3413a4154b0c29f50992ffa3602cf67d4d..674150a007084bf399ef234a1b94d9e41702d025 100644 --- a/result_search.php +++ b/result_search.php @@ -2,7 +2,32 @@ <!-- https://jsfiddle.net/69ww31n3/ --> <?php include "./config/database.php"; -include "header.php"; + +$tag = $_GET["email"]; +$influenceurs = $bdd->query("SELECT `nom_artiste`, `tag_youtube`, `tag_instagram` FROM `influenceurs` WHERE `nom_artiste`='$tag'"); +if ($inf=$influenceurs->fetch()) { + if (isset($_GET["youtube"])) { + if (isset($_GET["instagram"])) { + if (!empty($inf['tag_youtube']) && !empty($inf['tag_instagram'])) { + header('Location: page_globale.php?user='.$tag); + } + } + else { + if (!empty($inf['tag_youtube'])) { + header('Location: youtube?user='.$inf['tag_youtube']); + } + } + } + else { + if (isset($_GET["instagram"])) { + if (!empty($inf['tag_instagram'])) { + header('Location: instagram-profil.php?user='.$inf['tag_instagram']); + } + } + } + } + + include "header.php"; ?> <!-- ADD TO FAVORITES JS CODE --> @@ -50,7 +75,6 @@ $(document).ready(function(){ <table class="table"> <tbody> <?php - $tag = $_GET["email"]; /* récupération des données de la table influenceurs */ if ((isset($_GET["youtube"]) && isset($_GET["instagram"])) || (!isset($_GET["youtube"]) && !isset($_GET["instagram"]))) { $result = $bdd->query("SELECT * FROM `influenceurs` WHERE `nom_artiste` LIKE '$tag%' OR `tag_youtube` LIKE '$tag%' OR `tag_instagram` LIKE '$tag%' ORDER BY `nom_artiste`");