bonsoir les amis . et je suis dans un terrible probleme
voici mon code php.lorsque je clique sur par exemple sur le lien
Code : Sélectionner tout - Visualiser dans une fenêtre à part
<a href="index.php?contenu=rechercher">
cela m' affiche dans ma div pub le contenu .il n'y a pas de probleme a ce niveau. mais au fait je veux qu'on puisse afficher un loader le temps que sa charge les element dans ma div pub. voici tout le code source
Code php : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
<?php
try{
	$bdd = new PDO('mysql:host=localhost;dbname=gestion_etudiant', 'root', '');
}
catch (Exception $e){
	die('Erreur : ' . $e->getMessage());
}
if(isset($_POST['enregistrer'])){
	if(($_POST['mat'])==''||$_POST['nom']==''|| $_POST['prenom']==''||$_POST['age']==''||$_POST['sexe']==''||$_POST['contact']==''){
		$message = 'Veuillez bien renseigner les champ svp';
	}
	else{
		$mat = $_POST['mat'];
		$nom =$_POST['nom'];
		$sexe =$_POST['sexe'];
		$prenom =$_POST['prenom'];
		$age =$_POST['age'];
		$contacts =$_POST['contact'];
		$req = $bdd->prepare ('INSERT INTO etudiant (matricule,nom,prenom,contacts,sexe,age)values(:matricule,:nom,:prenom,:contacts,:sexe,:age)');
		$req->execute(array(
			'matricule' => $mat,
			'nom' => $nom,
			'prenom' => $prenom,
			'contacts' => $contacts,
			'sexe' => $sexe,
			'age' => $age
		));
		if($req){
			$message1= 'requette executee avec succes';
		}
		 else{
			 $message1= 'Erreur de requette';
		}
	}
}
?>
<html>
  <head>
	<title></title>
    <link rel="stylesheet" style="text/css" href="style.css"/>
    <meta charset='UTF-8'/>
  <head>
  <body bgProperties="fixed" style="background-attachment:fixed;background-repeat:no-repeat;background-position:top center;">
	<div id="contenneur">
		<div id="barniere"><img src="images/barner.jpg" alt="la barniere"/></div >
	   	<hr/>
	     <!-- <p ><h3><center><font color="red">Tous les elements precedes d'un asterissse sont obligatoires</font></center></p>--->
		<!-- FORMULAIRE DE DE LA PAGE DE MENU--->
		<div id="menu_gauche"><img src="images/titremenu.jpg" alt="bar_de_news"style="margin-top:-5px;margin-bottom:3px ";/>
			<ul class="menu">
				<li> <a href="index.php?contenu=enregistrer"><img src="images/bouton1.gif" alt="enregistrer"></a></li>
			   <!-- <li> <a href="#"><img src="images/bouton1_02.gif" alt="enregistrer"></a></li>--->
			 <li> <a href="index.php?contenu=rechercher"><img src="images/bouton2.gif" alt="rechercher"></a></li>
			 <li> <a href="index.php?contenu=liste"><img src="images/bouton3.gif" alt="Faire la liste"></a></li>
			</ul>
	    </div>
	     <div id="pub">
<?php
$contenu= $_GET['contenu'];
if($contenu=='enregistrer'){
	echo'<center><h2><font color="red"> Veuillez renseigner le formulaire</font></h2></center>';
	if (isset($message)){ // On a un message à afficher ?
		echo '<center><p><font color="red">', $message, '</font></p></center>';// Si oui, on l'affiche.
	}
	echo'
	 <form method="POST" action="" >
		<table border="0" align="center">
			<tr>
				<td>Matricule</td>
				<td><input type="text" name="mat"/></td>
			</tr>
			<tr>
				<td>Nom</td>
				<td><input type="text" name="nom"</td>
			</tr>
			<tr>
				<td>Prenom</td>
				<td><input type="text" name="prenom"</td>
			</tr>
			<tr>
				<td>Contact</td>
				<td><input type="text" name="contact"</td>
			</tr>
			<tr>
				<td> Sexe</td>
				<td>
					<select name="sexe" id="sexe">
                                             <option value="M">M</option>
                                             <option value="F">F</option>
                                          </select>
                              </td>
			</tr>
			<tr>
				<td>Age</td>
				<td><input type="text" name="age"</td>
			</tr>
			<tr>
				<td><input type="submit" value="ENREGISTRER" name="enregistrer"></td>
				<td>
				<td><input type="reset" value="ANNULER"</td>
			</tr>
		</table>
	</form>
';
if (isset($message1)){ // On a un message à afficher ?
	echo '<center><p><font color="greenn">', $message1, '</font></p></center>';// Si oui, on l'affiche.
}  
} 
else if($contenu=='rechercher'){
	echo'
		<center><h2><font color="blue"><h3>Rechercher selon le matricule</h3></font></h2></center>
		<hr/>	
		<form method="POST" action="">
			<table border="0" align="center">
				<tr>
					<td>N° matricule </td>
					<td><input type="text" name="mat_recherche"</td>
				</tr>
				<tr>
					<td></td>
					<td></td>
				</tr>
				<tr>
					<td></td>
					<td></td>
				</tr>
				<tr>
					<td></td>
					<td></td>
				</tr>
				<tr>
					<td><input type="submit" value ="valider" name="recherche"></td>
					<td>
					<td><input type="reset" value ="reinitialiser "name="ANNULERRECHERCHE"</td>
				</tr>
			</table>
		</form>
	';
	if(isset($_POST['recherche'])){
		$req = $bdd->prepare('SELECT * FROM etudiant WHERE matricule = ?');
		$req->execute(array($_POST['mat_recherche']));
		while($ligne=$req->fetch()){
			echo
				'<table border = 1 align = center>
					<tr>
						<th> Matricule</th>
						<th> nom</th>
						<th> prenom</th>
						<th> contacts</th>
						<th> sexe</th>
						<th> age</th>
					</tr>
					<tr>
						<td>'.$ligne['matricule'].'</td>
						<td>'.$ligne['nom'].'</td>
						<td>'.$ligne['prenom'].'</td>
						<td>'.$ligne['contacts'].'</td>
						<td>'.$ligne['sexe'].'</td>
						<td>'.$ligne['age'].'</td>
					</tr>
				</table>';
		}
	}
}   
else{
	echo'
		<center><h2><font color="blue"><h3>Liste des inscrits</h3></font></h2></center>
		<hr/>;
		<form method="POST" action="">
			<table align = center>
				<tr><td><input type="submit" value ="Voir la liste des personnes enregistré" name="liste"></td></tr>
			</table>
		</form>';
	if(isset($_POST['liste'])){
		$req = $bdd->query('SELECT * FROM etudiant');
?>
						<table border = 1 align = center>
							<tr>
								<th> Matricule</th>
								<th> nom</th>
								<th> prenom</th>
								<th> contacts</th>
								<th> sexe</th>
								<th> age</th>
						</tr>
<?php
while($ligne=$req->fetch()){
	echo
		/*'<table border = 1 align = center>
			<tr>
				<th> Matricule</th>
				<th> nom</th>
				<th> prenom</th>
				<th> contacts</th>
				<th> sexe</th>
				<th> age</th>
			</tr>*/
			'<tr>
				<td>'.$ligne['matricule'].'</td>
				<td>'.$ligne['nom'].'</td>
				<td>'.$ligne['prenom'].'</td>
				<td>'.$ligne['contacts'].'</td>
				<td>'.$ligne['sexe'].'</td>
				<td>'.$ligne['age'].'</td>
			</tr>
		';
}?>
							</table>
<?php
	}
}   
;
?> 
<!--<img src="images/index4.jpg"alt="images" height="420px" width="680px"/>-->
</div>
</div>
</div>
<div id="footer">
	<!-- Début du code du menu jeux d'Astwinds http://www.astwinds.com/--><noscript><a href="http://www.astwinds.com/">menu defilant des jeux<br>d'Astwinds</A></noscript><iframe name="http://www.astwinds.com/ - partenaires" src="http://www.astwinds.com/Services/defilanthorizontal.html" width="100%" height="60" frameborder=0 scrolling=no></iframe><!-- Fin du code du menu jeux d'Astwinds  <a href="http://www.astwinds.com/" target="_blank">http://www.astwinds.com/</a> --> 
	<div id="ppied"><center><font color="#fff">Copyright@----Tous Droits reservé----</font></center></div>
</div>
</body>
</html>
si quelqu'un pourrais m'aider merci