Salut,
1) Ecrit correctement ton code html c'est mieux !!!
2) <? c'est pas super donc <?php
Voici le code modifié :
<?php
if(!IsSet($_POST['Mot'])){$_POST['Mot'] = NULL;}
$cnx = mysql_connect('localhost','root','');
mysql_select_db('admin',$cnx);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css" media="screen">
body {
font-family: comic sans ms, arial;
background-image: url(image/surfseul.gif);
}
.center {
text-align: center;
}
</style>
<title>Recherche Membre</title></head>
<body>
<p class="center"><img src="image\licep.bmp" alt="licep.bmp" /></p>
<br />
<br />
<form method="POST" action="rechM.php">
Entrez un mot clé:<br />
<input type="text" name="Mot" id="Mot" size="20" />
<input type="hidden" name="Mot" id="Mot" value='.$val['Mot'].' />
<input type="submit" value="Rechercher" title="Lancer la recherche!" />
<table border="1" cellspacing="0" cellpadding="5" width="100%">
<?php
if(isset($_POST['Mot']) && ($_POST['Mot'] == '') || ($_POST['Mot'] == '%')){
echo 'Veuillez entrer un mot clé s\'il vous plaît!<br />';
}else{
$SQL = 'SELECT nomM from membre where nomM LIKE
\'%'.$_POST['Mot'].'%\'OR prenomM LIKE \'%'.$_POST['Mot'].'%\' ';
$res = mysql_query($SQL);
while($val=mysql_fetch_array($res)){
echo '<tr><td>'
,$val['idM']
,' - ',$val['nomM']
,'-',$val['prenomM']
,'</td></tr>';
}
}
echo '</table>',"\n",'</body></html>';
mysql_close();
?>
Immortal-PC,
téléchargements,astuces ,entre-aide informatique , conseils pour vos problèmes d'ordi.