1 pièce(s) jointe(s)
reconnaissance erronée du PHP
Bonjour,
Un petit problème : le script que j'écris dans un fichier .PHP avec pour balises :
ne renvoie pas le PHP correctement.
J'ai supprimé le et c'est bon.
Par contre, dans un autre fichier où il y a plus de code, c'est le bazar!!!:massacre: Voici un exemple (c'est un exercice pour apprendre le PHP, donc, un code simple :
Code:
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
| </head>
<body>
<h1> TD2 Exercice 3 </h1>
<form name="input" method="get">
Montant du Capital:
<input type="text" name="capital" size="10">
<br>
Taux d'interet annuel:
<input type="text" name="taux" size="2">
<br>
Duree en annees:
<input type="text" name="duree" size="10">
<br>
Avec assurance:
<input type="checkbox" name="assurance" value="yes">
<br>
<input type="submit" value="Submit">
</form>
<br>
<?php
// on essaiye le fonction
$length = sizeof($_GET);
//echo "$length<br>";
if ($length > 0){
$c = $_GET[capital];
$t = $_GET[taux];
$n = $_GET[duree];
$a = $_GET[assurance];
echo "<br>";
//echo "$c , $t , $n , $a ";
$m = yearly($c,$t,$n,$a);
$rm = round($m,2);
echo "la mensualité: $rm";
}
echo "</br>";
?>
</body>
</html> |
En pièce jointe, la photo du résultat!!!
Quelqu'un peut-il me dire ce qu'il se passe ??? merci, c'est assez urgent.