je vous poste la page que j'ai actuellement, j'affiche en haut d'un tableau une valeur qui est la force du personnage principal,
dans le tableau du dessous les pseudos d'autres membres avec leur force mini et force maxi, et je souhaiterai que quand la force maxi est inférieure a celle du personnage elle s'affiche en vert sinon en rouge...
merci de votre aide
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<title>liste des ennemi</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" media="screen" type="text/css" title="combats" href="presentation.css" />
<?php include ("menu.php"); ?>
<?php include ("entete.php"); ?>
</head>
<body>
<?php ///////////////////////// test
//On se connecte a la Base de donnee
include('mysqlcnn.php');
if(isset($_SESSION['pseudo']))
{
$pseudo = intval($_SESSION['pseudo']);
// $dn = mysql_query('select pseudo, force from membre where pseudo="'.$_SESSION['pseudo'].'"')
$dnn = mysql_fetch_array(mysql_query('select pseudo, avatar, force from membre where pseudo="'.$_SESSION['pseudo'].'"'))
//On affiche les donnees de lutilisateur
?>
<center>
Profil perso de "<?php echo htmlentities($dnn['pseudo']); ?>" :
</center>
<table style="margin:auto;width:500px;">
<tr>
<td><?php
if($dnn['avatar']!='')
{
echo '<img src="'.htmlentities($dnn['avatar']).'" alt="Image Perso" style="max-width:100px;max-height:100px;" />';
}
else
{
echo 'Vous n\'a pas d\'image perso.';
}
?>
</td>
<td><span style="font-size:30px;"><?php echo htmlentities($dnn['pseudo']); ?></span><br />
Puissance : <?php echo htmlentities($dnn['force']); ?><br />
</td>
</tr>
</table>
<center>
liste des ennemis:
</center>
<table>
<tr>
<th>Id</th>
<th>Pseudo</th>
<th>Bande</th>
<th>force mini</th>
<th>force maxi</th>
</tr>
<?php
//On recupere les identifiants, les pseudo et les nom de bande des ennemis
$req = mysql_query("select id, pseudo, bande, forcemini, forcemaxi from ennemi");
while($dnn = mysql_fetch_array($req))
{
?>
<tr>
<td><?php echo $dnn['id']; ?></td>
<td><?php echo htmlentities($dnn['pseudo']); ?></a></td>
<td><?php echo htmlentities($dnn['bande']); ?></td>
<td><?php echo htmlentities($dnn['forcemini']); ?></td>
<td><?php echo htmlentities($dnn['forcemaxi']); ?></td>
</tr>
<?php
}
?>
</table>
<?php
}
else
{
?>
<center>
La connection est obligatoire pour acceder à cette page.<br />
<a href="connection.php">se connecter</a>
</center>
<?php
}
?>
</body>
</html>