Moteur de recherche php mysqli

Messages postés
8
Date d'inscription
samedi 29 avril 2017
Dernière intervention
8 mai 2017
- - Dernière réponse : ghnadou1
Messages postés
8
Date d'inscription
samedi 29 avril 2017
Dernière intervention
8 mai 2017
- 8 mai 2017 à 18:39
bonjour
je suis en train de faire un site pour recherche d'emploi, je fais mon bouton recherche comme sur code :
<div class="modal fade" id="smallModal" tabindex="-1" role="dialog">
 
                <div class="modal-dialog modal-sm" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h4 class="modal-title" id="smallModalLabel">OFFRES DES STAGES</h4>
                        </div>
                        <form method="post" action="">
                        <div class="modal-body">
                        
                           <input placeholder="libelle" type="text" id="form-control" class="form-control text"  name="libstage" required="true">
                        
						<br> <br>
                        
						<select name="ident"  class="form-control show-tick"  style="width:250px;height:43px" required="true">
						<option selected="selected" value="0"> --Selectionner Entreprise-- </option>
						
						<?php
						
						include('db.php');
						
						$sql=mysqli_query($mysqli,"select * from entreprise order by nom");
						while($row=mysqli_fetch_array($sql, MYSQLI_ASSOC))
						{
						echo '<option value="'.$row['id'].'">'.$row['nom'].'</option>';
						}
						 ?>

						</select>
                        </div>
                        <div class="modal-footer">
                            <button type="submit" name="chercher" class="btn btn-link waves-effect">chercher</button>
                            <button type="button" class="btn btn-link waves-effect" data-dismiss="modal">annuler</button>
                          <?php
				if(isset($_POST['chercher']))
				{
					$ident = $_POST['ident'];
					$libstage = $_POST['libstage'];
					header("location: resrech.php?ident=".$ident."");
				}
				?>



                        </div>
                        </form>
                    </div>
                </div>
                
				
            </div>
              
            <script src="all/js/pages/ui/modals.js"></script>
            <!-- Dropzone Plugin Js -->
    <script src="all/plugins/dropzone/dropzone.js"></script>
</body>
</html>




mais toujours c'est erreur que s'affiche ( ! ) Warning: Cannot modify header information - headers already sent by (output started at C:\wamp64\www\nadia projet\index.php:176) in C:\wamp64\www\nadia projet\index.php on line 196
line 196 correspond a: header("location: resrech.php?ident=".$ident."");
Afficher la suite 

Votre réponse

3 réponses

Messages postés
23658
Date d'inscription
mercredi 22 octobre 2003
Statut
Modérateur
Dernière intervention
19 décembre 2018
0
Merci
Bonjour,

Ce message apparait car avant un header .. tu ne dois rien afficher.
pour que ton code soit plus propre tu peux faire comme ceci.

NB :
Déjà .. on place le maximum de code php AVANT le code html.
Ensuite... on récupère proprement les variables AVANT de les utiliser.


<?php
//Activation affichage des erreurs PHP
error_reporting(E_ALL);
ini_set('display-errors','on');

//connexion à la bdd
require_once 'db.php';


//récupération PROPRE des variables AVANT de les utiliser
//pour ça.. j'utilise l'écriture TERNAIRE avec un !EMPTY
 $chercher = !empty($_POST['chercher']) ? $_POST['chercher'] : NULL;
 $ident = !empty($_POST['ident']) ? $_POST['ident'] : NULL;
 $libstage = !empty($_POST['libstage']) ? $_POST['libstage'] : NULL;

  //traitement du SUBMIT
  if($chercher){
		header("location: resrech.php?ident=".$ident);
    exit(); //toujours un exit après un header loction
	}
 
 //récupération des infos à afficher dans le select
 $sql = "select * from entreprise order by nom";
 $query=mysqli_query($mysqli,$sql);
 

 
//ensuite tu peux mettre ton html: 
?>
<html>
  <head>
    <meta charset='utf8'></meta>
    <title> Ton titre </title>
  </head>
  <body>

    <div class="modal fade" id="smallModal" tabindex="-1" role="dialog">
      <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <h4 class="modal-title" id="smallModalLabel">OFFRES DES STAGES</h4>
          </div>
          <form method="post" action="">
            <div class="modal-body">
              <input placeholder="libelle" type="text" id="form-control" class="form-control text"  name="libstage" required="true">
              <br> <br>
              <select name="ident"  class="form-control show-tick"  style="width:250px;height:43px" required="true">
                <option selected="selected" value="0"> --Selectionner Entreprise-- </option>
                <?php
                while($row=mysqli_fetch_array($query, MYSQLI_ASSOC)){
                   echo '<option value="'.$row['id'].'">'.$row['nom'].'</option>';
                }
                ?>
              </select>
            </div>
            <div class="modal-footer">
              <button type="submit" name="chercher" class="btn btn-link waves-effect">chercher</button>
              <button type="button" class="btn btn-link waves-effect" data-dismiss="modal">annuler</button>
            </div>
          </form>
        </div>
    </div>
   </div>
   <script src="all/js/pages/ui/modals.js"></script>
   <!-- Dropzone Plugin Js -->
   <script src="all/plugins/dropzone/dropzone.js"></script>
  </body>
</html> 


Ensuite... plutôt que de faire une redirection ... vu que tu semble vouloir faire la recherche sur une autre page .. pourquoi ne pas simplement mettre une action dans ta form ?

<form method="post" action="resrech.php">

Bien entendu.. les variables alors reçues dans ta page resrech.php ne seront plus en get mais en POST .....


ghnadou1
Messages postés
8
Date d'inscription
samedi 29 avril 2017
Dernière intervention
8 mai 2017
-
bonjour
merci
voila mon page resrech.php , je le fais plus tot pour afficher le résultat
<?php
session_start();
if(!empty($_SESSION["login_admin"])){
if($_SESSION["login_admin"]=="admin")
header("Location: espaceAdmin/");
else {

header("Location: espaceetudiant/");
}

}
?>
<!DOCTYPE HTML>
<html>
<head>

<title>STAGE | FRANCE</title>
<link rel="shortcut icon" type="image/x-icon" href="images/fr.png" />
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel='stylesheet' type='text/css' />
<link href="css/bootstrap.css" rel='stylesheet' type='text/css' />
<meta name="viewport" content="width=device-width, initial-scale=1">

<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<!-- start plugins -->
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<!-- start slider -->
<link href="css/slider.css" rel="stylesheet" type="text/css" media="all" />
<!-- Dropzone Css -->
<link href="all/plugins/dropzone/dropzone.css" rel="stylesheet">

<script type="text/javascript" src="js/modernizr.custom.28468.js"></script>
<script type="text/javascript" src="js/jquery.cslider.js"></script>
<script type="text/javascript">
$(function() {

$('#da-slider').cslider({
autoplay : true,
bgincrement : 450
});

});
</script>
<!-- Owl Carousel Assets -->
<link href="css/owl.carousel.css" rel="stylesheet">
<script src="js/owl.carousel.js"></script>

<!-- //Owl Carousel Assets -->
<!--font-Awesome-->
<link rel="stylesheet" href="fonts/css/font-awesome.min.css">
<!--font-Awesome-->

</head>
<body>
<div class="header_bg">
<div class="container">
<div class="row header">
<img src="images/fr.png" style="margin-top:26px;margin-left:-370px" width="30" height="30">
<div class="logo navbar-left">
<h1 style="margin-left:60px"><a href="index.php" rel="nofollow noopener noreferrer" target="_blank"><span class="Style3"></span>STAGE POUR VOUS</a></h1>
</div>

<div class="h_search navbar-right" >

<button style="margin-left:190px;width:160px" class="btn bg-pink waves-effect" data-toggle="modal" data-target="#smallModal">RECHERCHE RAPIDE</button>




</div>
<div class="clearfix"></div>
</div>
</div>
</div>
<div class="container">
<div class="row h_menu">
<nav class="navbar navbar-default navbar-left" role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active"><a href="index.php" rel="nofollow noopener noreferrer" target="_blank">Accueil</a></li>
<li><a href="login.php" rel="nofollow noopener noreferrer" target="_blank">Espace Privee</a></li>
<li><a href="inscrit.php" rel="nofollow noopener noreferrer" target="_blank">Inscription</a></li>

<li><a href="contact.php" rel="nofollow noopener noreferrer" target="_blank">Contact</a></li>
</ul>
</div><!-- /.navbar-collapse -->
<!-- start soc_icons -->
</nav>
<div class="soc_icons navbar-right">
<ul class="list-unstyled text-center">


<li><a href="#" rel="nofollow noopener noreferrer" target="_blank"><i class="fa fa-twitter"></i></a></li>
<li><a href="#" rel="nofollow noopener noreferrer" target="_blank"><i class="fa fa-facebook"></i></a></li>


<li><a href="#" rel="nofollow noopener noreferrer" target="_blank"><i class="fa fa-youtube"></i></a></li>


</ul>
</div>
</div>
</div>


<div class="main_bg">

</div>
<div class="container">

<?php
include('db.php');


if((isset($_GET['libstage'])) && (isset($_GET['ident'])))
{
$libstage = $_GET['libstage'];
$ident = $_GET['ident'];

if($result=mysqli_query($mysqli,"SELECT * FROM stage s , entreprise e where e.id=s.ident and s.libstage like '%".$libstage."%'"))
{
if(!empty($result))
{

echo '<table class="table table-striped table-bordered table-hover">';
echo '<thead>';
echo '<tr>';
echo '<th style="font-size:17px">#</th>';

echo '<th style="font-size:17px">ENTREPRISE</th>';
echo '<th style="font-size:17px">VILLE</th>';
echo '<th style="font-size:17px">EMAIL</th>';
echo '<th style="font-size:17px">TELEPHONE</th>';
echo '<th style="font-size:17px">ADRESSE</th>';
echo '<th style="font-size:17px">LIBELLE</th>';






echo '</tr>';
echo '</thead>';
echo '<tbody>';
$i=1;
while($row = mysqli_fetch_array($result, MYSQLI_ASSOC))
{
echo '<tr>';
echo '<td style="font-size:17px">'.$i.'</td>';

echo '<td style="font-size:17px">'.$row["nom"].'</td>';
echo '<td style="font-size:17px">'.$row["nomv"].'</td>';
echo '<td style="font-size:17px">'.$row["email"].'</td>';
echo '<td style="font-size:17px">'.$row["tel"].'</td>';
echo '<td style="font-size:17px">'.$row["adresse"].'</td>';
echo '<td style="font-size:17px">'.$row["libstage"].'</td>';


echo '</tr>';
$i++;
}
echo '</tbody>';
}

else {echo '<p>n\'a trouvé aucune stage avec cette libelle "'.$_GET['libstage'].'"...</p>';}


}}



if(isset($_POST['chercher']))
{
$libstage = $_GET['libstage'];
$ident = $_GET['ident'];

if($result=mysqli_query($mysqli,"SELECT * FROM stage s , entreprise e where e.id=s.ident and s.libstage like '%".$libstage."%'"))
{
if(!empty($result))
{

echo '<table class="table table-striped table-bordered table-hover">';
echo '<thead>';
echo '<tr>';
echo '<th style="font-size:17px">#</th>';

echo '<th style="font-size:17px">ENTREPRISE</th>';
echo '<th style="font-size:17px">VILLE</th>';
echo '<th style="font-size:17px">EMAIL</th>';
echo '<th style="font-size:17px">TELEPHONE</th>';
echo '<th style="font-size:17px">ADRESSE</th>';
echo '<th style="font-size:17px">LIBELLE</th>';






echo '</tr>';
echo '</thead>';
echo '<tbody>';
$i=1;
while($row = mysqli_fetch_array($result, MYSQLI_ASSOC))
{
echo '<tr>';
echo '<td style="font-size:17px">'.$i.'</td>';

echo '<td style="font-size:17px">'.$row["nom"].'</td>';
echo '<td style="font-size:17px">'.$row["nomv"].'</td>';
echo '<td style="font-size:17px">'.$row["email"].'</td>';
echo '<td style="font-size:17px">'.$row["tel"].'</td>';
echo '<td style="font-size:17px">'.$row["adresse"].'</td>';
echo '<td style="font-size:17px">'.$row["libstage"].'</td>';


echo '</tr>';
$i++;
}
echo '</tbody>';
}
?>
</div>
<br><br>





<div class="footer_bg"><!-- start footer -->
<div class="container">
<div class="row footer">
<div class="copy text-center">
<p class="link"><span>© All rights reserved | Design by <a href=""> NADIA GHAZALI </a></span></p>
</div>
</div>
</div>
</div>



<script src="all/js/pages/ui/modals.js"></script>
<!-- Dropzone Plugin Js -->
<script src="all/plugins/dropzone/dropzone.js"></script>
</body>
</html>
Commenter la réponse de jordane45
Messages postés
8
Date d'inscription
samedi 29 avril 2017
Dernière intervention
8 mai 2017
0
Merci
Mon page index.php complete

<!DOCTYPE HTML>
<html>
<head>

<title>STAGE | FRANCE</title>
<link rel="shortcut icon" type="image/x-icon" href="images/fr.png" />
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel='stylesheet' type='text/css' />
<link href="css/bootstrap.css" rel='stylesheet' type='text/css' />
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<!-- start plugins -->
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<!-- start slider -->
<link href="css/slider.css" rel="stylesheet" type="text/css" media="all" />
<!-- Dropzone Css -->
<link href="all/plugins/dropzone/dropzone.css" rel="stylesheet">

<script type="text/javascript" src="js/modernizr.custom.28468.js"></script>
<script type="text/javascript" src="js/jquery.cslider.js"></script>
<script type="text/javascript">
$(function() {

$('#da-slider').cslider({
autoplay : true,
bgincrement : 450
});

});
</script>
<!-- Owl Carousel Assets -->
<link href="css/owl.carousel.css" rel="stylesheet">
<script src="js/owl.carousel.js"></script>
<script>
$(document).ready(function() {

$("#owl-demo").owlCarousel({
items : 1,
lazyLoad : true,
autoPlay : true,
navigation : true,
navigationText : ["", ""],
rewindNav : false,
scrollPerPage : false,
pagination : false,
paginationNumbers : false,
});

});
</script>
<!-- //Owl Carousel Assets -->
<!--font-Awesome-->
<link rel="stylesheet" href="fonts/css/font-awesome.min.css">
<!--font-Awesome-->

</head>
<body>
<div class="header_bg">
<div class="container">
<div class="row header">
<img src="images/fr.png" style="margin-top:26px;margin-left:-370px" width="30" height="30">
<div class="logo navbar-left">
<h1 style="margin-left:60px"><a href="index.php" rel="nofollow noopener noreferrer" target="_blank"><span class="Style3"></span>STAGE POUR VOUS</a></h1>
</div>

<div class="h_search navbar-right" >

<button style="margin-left:190px;width:160px" class="btn bg-pink waves-effect" data-toggle="modal" data-target="#smallModal">RECHERCHE RAPIDE</button>




</div>
<div class="clearfix"></div>
</div>
</div>
</div>
<div class="container">
<div class="row h_menu">
<nav class="navbar navbar-default navbar-left" role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active"><a href="index.php" rel="nofollow noopener noreferrer" target="_blank">Accueil</a></li>
<li><a href="login.php" rel="nofollow noopener noreferrer" target="_blank">Espace Privee</a></li>
<li><a href="inscrit.php" rel="nofollow noopener noreferrer" target="_blank">Inscription</a></li>

<li><a href="contact.php" rel="nofollow noopener noreferrer" target="_blank">Contact</a></li>
</ul>
</div><!-- /.navbar-collapse -->
<!-- start soc_icons -->
</nav>
<div class="soc_icons navbar-right">
<ul class="list-unstyled text-center">


<li><a href="#" rel="nofollow noopener noreferrer" target="_blank"><i class="fa fa-twitter"></i></a></li>
<li><a href="#" rel="nofollow noopener noreferrer" target="_blank"><i class="fa fa-facebook"></i></a></li>


<li><a href="#" rel="nofollow noopener noreferrer" target="_blank"><i class="fa fa-youtube"></i></a></li>


</ul>
</div>
</div>
</div>


<div class="main_bg"><!-- start main -->

</div><!-- end main -->
<br>
<!-- start main_btm -->
<div class="container">

<!----start-img-cursual---->
<div id="owl-demo" class="owl-carousel text-center">
<img src="images/a.jpg" width="950" height="450">
<img src="images/b.jpg" width="950" height="450">
<img src="images/c.png" width="950" height="450">
<img src="images/d.png" width="950" height="450">
</div>
<!----//End-img-cursual---->
</div>
<br><br>





<div class="footer_bg"><!-- start footer -->
<div class="container">
<div class="row footer">
<div class="copy text-center">
<p class="link"><span>© All rights reserved | Design by <a href=""> NADIA GHAZALI </a></span></p>
</div>
</div>
</div>
</div>


<div class="modal fade" id="smallModal" tabindex="-1" role="dialog">

<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="smallModalLabel">OFFRES DES STAGES</h4>
</div>
<form method="post" action="">
<div class="modal-body">

<input placeholder="libelle" type="text" id="form-control" class="form-control text" name="libstage" required="true">

<br> <br>

<select name="ident" class="form-control show-tick" style="width:250px;height:43px" required="true">
<option selected="selected" value="0"> --Selectionner Entreprise-- </option>
<?php

include('db.php');

$sql=mysqli_query($mysqli,"select * from entreprise order by nom");
while($row=mysqli_fetch_array($sql, MYSQLI_ASSOC))
{
echo '<option value="'.$row['id'].'">'.$row['nom'].'</option>';
}
?>
</select>
</div>
<div class="modal-footer">
<button type="submit" name="chercher" class="btn btn-link waves-effect">chercher</button>
<button type="button" class="btn btn-link waves-effect" data-dismiss="modal">annuler</button>
<?php
if(isset($_POST['chercher']))
{
$ident = $_POST['ident'];
$libstage = $_POST['libstage'];
header("location: resrech.php?ident=".$ident."");
}
?>


</div>
</form>
</div>
</div>


</div>



<script src="all/js/pages/ui/modals.js"></script>
<!-- Dropzone Plugin Js -->
<script src="all/plugins/dropzone/dropzone.js"></script>
</body>
</html>
Commenter la réponse de ghnadou1
Messages postés
8
Date d'inscription
samedi 29 avril 2017
Dernière intervention
8 mai 2017
0
Merci
Bonjour,
En faite , j'ai fait comme tu m'a dit mais s'affiche rien
ghnadou1
Messages postés
8
Date d'inscription
samedi 29 avril 2017
Dernière intervention
8 mai 2017
> jordane45
Messages postés
23658
Date d'inscription
mercredi 22 octobre 2003
Statut
Modérateur
Dernière intervention
19 décembre 2018
-
dans la page resrech.php
( ! ) Parse error: syntax error, unexpected end of file in C:\wamp64\www\nadia projet\resrech.php on line 263 c'est la dernier ligne <script src="all/plugins/dropzone/dropzone.js"></script>

</body>
</html>
jordane45
Messages postés
23658
Date d'inscription
mercredi 22 octobre 2003
Statut
Modérateur
Dernière intervention
19 décembre 2018
> ghnadou1
Messages postés
8
Date d'inscription
samedi 29 avril 2017
Dernière intervention
8 mai 2017
-
Le message d'erreur te parles du fichier resrech.php ...
Quel est son code ??
Sachant que cela signifie que tu as sûrement une accolade ou une balise mal fermée
ghnadou1
Messages postés
8
Date d'inscription
samedi 29 avril 2017
Dernière intervention
8 mai 2017
-
sur la page reserch.php
<?php
session_start();
if(!empty($_SESSION["login_admin"])){
if($_SESSION["login_admin"]=="admin")
header("Location: espaceAdmin/");
else {

header("Location: espaceetudiant/");
}

}
?>
<!DOCTYPE html>

<html>
<head>

<title>STAGE | FRANCE</title>
<link rel="shortcut icon" type="image/x-icon" href="images/fr.png" />
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel='stylesheet' type='text/css' />
<link href="css/bootstrap.css" rel='stylesheet' type='text/css' />
<meta name="viewport" content="width=device-width, initial-scale=1">

<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<!-- start plugins -->
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<!-- start slider -->
<link href="css/slider.css" rel="stylesheet" type="text/css" media="all" />
<!-- Dropzone Css -->
<link href="all/plugins/dropzone/dropzone.css" rel="stylesheet">

<script type="text/javascript" src="js/modernizr.custom.28468.js"></script>
<script type="text/javascript" src="js/jquery.cslider.js"></script>
<script type="text/javascript">
$(function() {

$('#da-slider').cslider({
autoplay : true,
bgincrement : 450
});

});
</script>
<!-- Owl Carousel Assets -->
<link href="css/owl.carousel.css" rel="stylesheet">
<script src="js/owl.carousel.js"></script>

<!-- //Owl Carousel Assets -->
<!--font-Awesome-->
<link rel="stylesheet" href="fonts/css/font-awesome.min.css">
<!--font-Awesome-->

</head>
<body>
<div class="header_bg">
<div class="container">
<div class="row header">
<img src="images/fr.png" style="margin-top:26px;margin-left:-370px" width="30" height="30">
<div class="logo navbar-left">
<h1 style="margin-left:60px"><a href="index.php" rel="nofollow noopener noreferrer" target="_blank"><span class="Style3"></span>STAGE POUR VOUS</a></h1>
</div>

<div class="h_search navbar-right" >

<button style="margin-left:190px;width:160px" class="btn bg-pink waves-effect" data-toggle="modal" data-target="#smallModal">RECHERCHE RAPIDE</button>




</div>
<div class="clearfix"></div>
</div>
</div>
</div>
<div class="container">
<div class="row h_menu">
<nav class="navbar navbar-default navbar-left" role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active"><a href="index.php" rel="nofollow noopener noreferrer" target="_blank">Accueil</a></li>
<li><a href="login.php" rel="nofollow noopener noreferrer" target="_blank">Espace Privee</a></li>
<li><a href="inscrit.php" rel="nofollow noopener noreferrer" target="_blank">Inscription</a></li>

<li><a href="contact.php" rel="nofollow noopener noreferrer" target="_blank">Contact</a></li>
</ul>
</div><!-- /.navbar-collapse -->
<!-- start soc_icons -->
</nav>
<div class="soc_icons navbar-right">
<ul class="list-unstyled text-center">


<li><a href="#" rel="nofollow noopener noreferrer" target="_blank"><i class="fa fa-twitter"></i></a></li>
<li><a href="#" rel="nofollow noopener noreferrer" target="_blank"><i class="fa fa-facebook"></i></a></li>


<li><a href="#" rel="nofollow noopener noreferrer" target="_blank"><i class="fa fa-youtube"></i></a></li>


</ul>
</div>
</div>
</div>


<div class="main_bg">

</div>
<div class="container">

<?php
include('db.php');


if((isset($_GET['libstage'])) && (isset($_GET['ident'])))
{
$libstage = $_GET['libstage'];
$ident = $_GET['ident'];

if($result=mysqli_query($mysqli,"SELECT * FROM stage s , entreprise e where e.id=s.ident and s.libstage like '%".$libstage."%'"))
{
if(!empty($result))
{

echo '<table class="table table-striped table-bordered table-hover">';
echo '<thead>';
echo '<tr>';
echo '<th style="font-size:17px">#</th>';

echo '<th style="font-size:17px">ENTREPRISE</th>';
echo '<th style="font-size:17px">VILLE</th>';
echo '<th style="font-size:17px">EMAIL</th>';
echo '<th style="font-size:17px">TELEPHONE</th>';
echo '<th style="font-size:17px">ADRESSE</th>';
echo '<th style="font-size:17px">LIBELLE</th>';






echo '</tr>';
echo '</thead>';
echo '<tbody>';
$i=1;
while($row = mysqli_fetch_array($result, MYSQLI_ASSOC))
{
echo '<tr>';
echo '<td style="font-size:17px">'.$i.'</td>';

echo '<td style="font-size:17px">'.$row["nom"].'</td>';
echo '<td style="font-size:17px">'.$row["nomv"].'</td>';
echo '<td style="font-size:17px">'.$row["email"].'</td>';
echo '<td style="font-size:17px">'.$row["tel"].'</td>';
echo '<td style="font-size:17px">'.$row["adresse"].'</td>';
echo '<td style="font-size:17px">'.$row["libstage"].'</td>';


echo '</tr>';
$i++;
}
echo '</tbody>';
}

else {echo '<p>n\'a trouvé aucune stage avec cette libelle "'.$_GET['libstage'].'"...</p>';}


}}



if(isset($_POST['chercher']))
{
$libstage = $_GET['libstage'];
$ident = $_GET['ident'];

if($result=mysqli_query($mysqli,"SELECT * FROM stage s , entreprise e where e.id=s.ident and s.libstage like '%".$libstage."%'"))
{
if(!empty($result))
{

echo '<table class="table table-striped table-bordered table-hover">';
echo '<thead>';
echo '<tr>';
echo '<th style="font-size:17px">#</th>';

echo '<th style="font-size:17px">ENTREPRISE</th>';
echo '<th style="font-size:17px">VILLE</th>';
echo '<th style="font-size:17px">EMAIL</th>';
echo '<th style="font-size:17px">TELEPHONE</th>';
echo '<th style="font-size:17px">ADRESSE</th>';
echo '<th style="font-size:17px">LIBELLE</th>';






echo '</tr>';
echo '</thead>';
echo '<tbody>';
$i=1;
while($row = mysqli_fetch_array($result, MYSQLI_ASSOC))
{
echo '<tr>';
echo '<td style="font-size:17px">'.$i.'</td>';

echo '<td style="font-size:17px">'.$row["nom"].'</td>';
echo '<td style="font-size:17px">'.$row["nomv"].'</td>';
echo '<td style="font-size:17px">'.$row["email"].'</td>';
echo '<td style="font-size:17px">'.$row["tel"].'</td>';
echo '<td style="font-size:17px">'.$row["adresse"].'</td>';
echo '<td style="font-size:17px">'.$row["libstage"].'</td>';


echo '</tr>';
$i++;
}
echo '</tbody>';
}
?>
</div>
<br><br>





<div class="footer_bg"><!-- start footer -->
<div class="container">
<div class="row footer">
<div class="copy text-center">
<p class="link"><span>© All rights reserved | Design by <a href=""> NADIA GHAZALI </a></span></p>
</div>
</div>
</div>
</div>



<script src="all/js/pages/ui/modals.js"></script>
<!-- Dropzone Plugin Js -->
<script src="all/plugins/dropzone/dropzone.js"></script>

</body>
</html>
jordane45
Messages postés
23658
Date d'inscription
mercredi 22 octobre 2003
Statut
Modérateur
Dernière intervention
19 décembre 2018
> ghnadou1
Messages postés
8
Date d'inscription
samedi 29 avril 2017
Dernière intervention
8 mai 2017
-
Visiblement il manque des accolades fermantes pour tes if....
Je te laisse les chercher... j'ai la flemme de me taper tout ton code
ghnadou1
Messages postés
8
Date d'inscription
samedi 29 avril 2017
Dernière intervention
8 mai 2017
-
oui j'ai trouvé ou il y a l'accolades qui manques après il passe a la page resrech mais il affiche rien
Commenter la réponse de ghnadou1

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.