Bonjour, voici un petit code de formulaire
Code : 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
<!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>Exercice 3</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		 </head>
    <body>
<form method="get" action="calcule.php" enctype="multipart/form-data">
<input type="hidden" name="prix"/><br>
<input type="hidden" name="quantité"/>
<input type="submit" value="OK"/>
</form>
 
 
 
    </body>
</html>
Code : 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
<!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>Exercice 2</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		 </head>
    <body>
<?php
 
$p = $_POST.['prix'];
$q = $_POST.['quantité'];
$ht = $p * $q;
 
function toutetaxe($ht, $t)
{
   $ttc = $ht * $t ;
   return $ttc ;
} 
$ttc = toutetaxe($ht, 1.196);
 
echo("Le montant hors taxe est $ht").'<br />'; 
echo("Le montant TTC est ");
echo ROUND($ttc,2);
 
?>
 
    </body>
</html>
Quand je Valide le formulaire sa m'affiche ceci

Notice: Undefined index: prix in C:\Program Files\wamp\www\TD php\calcule.php on line 10

Notice: Undefined index: quantité in C:\Program Files\wamp\www\TD php\calcule.php on line 11

Peut-ton m'aider