1 réponse
ceto84
Messages postés
56
Date d'inscription
lundi 14 mai 2007
Statut
Membre
Dernière intervention
8 juin 2007
16
15 mai 2007 à 14:37
15 mai 2007 à 14:37
Je ne sais pas si ca t interesse en php mais j avais deja fais un truc ki pourrais t interesser.
Le formulaire pour ton tableau:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Cours PHP - Formulaire</title>
</head>
<body>
<h1>Formulaire d'entrée de donées</h1>
<form action="traitement.php" method="get">
Nombre de lignes <br /> <input type ="text" name="nbLigne" /> <br /><br />
Nombre de colonnes <br /> <input type ="text" name="nbColonne" /> <br /><br />
Couleur de fond <br />
<select name="couleurFond">
<option>E5DA23</option>
<option>DD1235</option>
<option>37C756</option>
</select>
</br></br>
<button type="submit">Envoyer</button>
</form>
</body>
</html>
et le traitement des infos:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Cours PHP - Traitement</title>
</head>
<body>
<h1>Traitement en PHP des données</h1>
<?
$nbLigne = $_REQUEST["nbLigne"] ;
$nbColonne = $_REQUEST["nbColonne"] ;
$couleurFond = $_REQUEST["couleurFond"] ;
$tx = (int)(800/$nbColonne) ;
$ty = $tx ;
print("<table border='1'>\n") ;
for ($i=1 ; $i<=$nbLigne ; $i++) {
print("<tr height='$ty'>\n") ;
for ($j=1 ; $j<=$nbColonne ; $j++) {
print("<td align='center' width='$tx' bgcolor='$couleurFond'>") ;
print("<b>" . $i * $j . "</b>") ;
print("</td>") ;
}
print("</tr>\n") ;
}
print("</table>\n") ;
?>
</body>
</html>
c pas tres compliqué a comprendre et tu peux surement trouver quelque chose ki t interesseras.
Le formulaire pour ton tableau:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Cours PHP - Formulaire</title>
</head>
<body>
<h1>Formulaire d'entrée de donées</h1>
<form action="traitement.php" method="get">
Nombre de lignes <br /> <input type ="text" name="nbLigne" /> <br /><br />
Nombre de colonnes <br /> <input type ="text" name="nbColonne" /> <br /><br />
Couleur de fond <br />
<select name="couleurFond">
<option>E5DA23</option>
<option>DD1235</option>
<option>37C756</option>
</select>
</br></br>
<button type="submit">Envoyer</button>
</form>
</body>
</html>
et le traitement des infos:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Cours PHP - Traitement</title>
</head>
<body>
<h1>Traitement en PHP des données</h1>
<?
$nbLigne = $_REQUEST["nbLigne"] ;
$nbColonne = $_REQUEST["nbColonne"] ;
$couleurFond = $_REQUEST["couleurFond"] ;
$tx = (int)(800/$nbColonne) ;
$ty = $tx ;
print("<table border='1'>\n") ;
for ($i=1 ; $i<=$nbLigne ; $i++) {
print("<tr height='$ty'>\n") ;
for ($j=1 ; $j<=$nbColonne ; $j++) {
print("<td align='center' width='$tx' bgcolor='$couleurFond'>") ;
print("<b>" . $i * $j . "</b>") ;
print("</td>") ;
}
print("</tr>\n") ;
}
print("</table>\n") ;
?>
</body>
</html>
c pas tres compliqué a comprendre et tu peux surement trouver quelque chose ki t interesseras.
15 mai 2007 à 15:01