Conditions à l'intérieur d'une autre conditio
Résolu
christophe.therrien
Messages postés
102
Date d'inscription
Statut
Membre
Dernière intervention
-
christophe.therrien Messages postés 102 Date d'inscription Statut Membre Dernière intervention -
christophe.therrien Messages postés 102 Date d'inscription Statut Membre Dernière intervention -
Bonjour, j'aimerais savoir s'il est possible d'introduire une condition (if, else, elseif) à l'intérieur d'une autre condition.
Par exemple
if {if{ ....}
else{...}
}
else{if{ ....}
else{...}
}
Merci
Par exemple
if {if{ ....}
else{...}
}
else{if{ ....}
else{...}
}
Merci
A voir également:
- Conditions à l'intérieur d'une autre conditio
- Télécharger simulateur de peinture intérieur gratuit - Télécharger - Divers Photo & Graphisme
- Logiciel aménagement intérieur gratuit - Guide
- Ecran telephone cassé de l'interieur ✓ - Forum Samsung
- Excel reporter des données sur une autre feuille avec conditions ✓ - Forum Excel
- Antenne tv intérieur action ✓ - Forum TNT / Satellite / Réception
20 réponses
Oui tu peux le faire autant que tu veux.
Par contre tu peux pas mettre deux fois else pour un même if.
Par exemple :
Est faux.
Par contre tu peux pas mettre deux fois else pour un même if.
Par exemple :
if(){} else{} else{}
Est faux.
Sur mon serveur j'ai un message d'erreur :
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /var/www/tmp/ccm2.php on line 11
Qui est tout as fait normal car tu concates mal tes variables. Tu dois faire par exemple echo "Ma variable ".$variable." la suite";
Voici ton script avec les points qu'il manque et j'ai aussi modifié certaines conditions (celles qui avaient des encadrements car tu ne peux pas faire u<$f<v tu dois faire u<$f && $f<v) :
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /var/www/tmp/ccm2.php on line 11
Qui est tout as fait normal car tu concates mal tes variables. Tu dois faire par exemple echo "Ma variable ".$variable." la suite";
Voici ton script avec les points qu'il manque et j'ai aussi modifié certaines conditions (celles qui avaient des encadrements car tu ne peux pas faire u<$f<v tu dois faire u<$f && $f<v) :
<? if(!preg_match("#^[0-9]+$#", $_POST['a']) || !preg_match("#^[0-9]+$#", $_POST['b']) || !preg_match("#^[0-9]+$#", $_POST['c']) || !preg_match("#^[0-9]+$#", $_POST['d']) || !preg_match("#^[0-9]+$#", $_POST['e']) || !preg_match("#^[0-9]+$#", $_POST['f']) || !preg_match("#^[0-9]+$#", $_POST['g']) || !preg_match("#^[0-9]+$#", $_POST['h']) || !preg_match("#^[0-9]+$#", $_POST['i']) || !preg_match("#^[0-9]+$#", $_POST['j']) || !preg_match("#^[0-9]+$#", $_POST['k']) || !preg_match("#^[0-9]+$#", $_POST['l']) || !preg_match("#^[0-9]+$#", $_POST['m']) || !preg_match("#^[0-9]+$#", $_POST['n']) || !preg_match("#^[0-9]+$#", $_POST['o']) || !preg_match("#^[0-9]+$#", $_POST['p']) || !preg_match("#^[0-9]+$#", $_POST['q']) || !preg_match("#^[0-9]+$#", $_POST['r'])) { ?> <Form>[...]</Form> <?php } else { $s=($_POST['a']+$_POST['c']+$_POST['e']+$_POST['g']); echo 'Revenu total (Provincial) :'.$s.'$'; $t=($_POST['b']+$_POST['d']+$_POST['f']+$_POST['h']); echo 'Revenu total (Fédéral) :'.$t.'$'; $u=($_POST['i']+$_POST['j']+$_POST['l']); echo 'Déductions totales (Provincial) :'.$u.'$'; $v=($_POST['k']+$_POST['m']); echo 'Déductions totales (Fédéral) :'.$v; $w=($_POST['s']-$_POST['u']); echo 'Revenu imposable (Provincial) :'.$w.'$'; $x=($_POST['t']-$_POST['v']); echo 'Revenu imposable (Fédéral) :'.$x.'$'; $y=(($_POST['n']+$_POST['o']+$_POST['q']+10375)*0.15); echo 'Crédits d\'impôts non remboursables (Provincial) :'.$y.'$'; $z=(($_POST['p']+$_POST['r']+10455)*0.2); echo 'Crédits d\'impôts non remboursables (Fédéral) :'.$z.'$'; if($_POST['w']>76770) { $aa=($_POST['w']*0.24); echo 'Impôt sur le revenu imposable (Provincial) :'.$aa.'$'; } elseif(38385<$_POST['w'] && $_POST['w']<=76770) { $aa=($_POST['w']*0.20); echo 'Impôt sur le revenu imposable (Provincial) :'.$aa.'$'; } else { $aa=($_POST['w']*0.16); echo 'Impôt sur le revenu imposable (Provincial) :'.$aa.'$'; } if($_POST['w']>123264) { $bb=$_POST['w']*0.29; echo 'Impôt sur le revenu imposable (Fédéral) :'.$bb.'$'; } elseif(82399<$_POST['w'] && $_POST['w']<=126264) { $bb=($_POST['w']*0.26); echo 'Impôt sur le revenu imposable (Fédéral) :'.$bb.'$'; } elseif(41200<$_POST['w'] && $_POST['w']<=82399) { $bb=($_POST['w']*0.22); echo 'Impôt sur le revenu imposable (Fédéral) :'.$bb.'$'; } else { $bb=($_POST['w']*0.15); echo 'Impôt sur le revenu imposable (Fédéral) :'.$bb.'$'; } $cc=($_POST['u']*0.1); echo 'Crédits d\'impôts pour dividendes (Provincial) :'.$cc.'$'; $dd=($_POST['v']*1.25*0.1333); echo 'Crédits d\'impôts pour dividendes (Fédéral) :'.$dd.'$'; $ee=($_POST['aa']-$_POST['y']-$_POST['cc']); echo '______________________________________'; echo 'Impôts à payer (provincial) :'.$ee.'$'; $ff=($_POST['bb']-$_POST['z']-$_POST['dd']); echo 'Impôts à payer (Fédéral) :'.$ff.'$'; echo '______________________________________'; } ?>
J'ai repris les champs du formulaire pour rajouter les données transmissent (les <?=$_POST['name'];?>) :
<form method="post" action=""> <table width="746" border="1"> <tr> <td width="336"><span class="style1">Revenus</span></td> <td width="194">Provincial (Québec)</td> <td width="194">Fédéral</td> </tr> <tr> <td>Revenus de salaire : </td> <td><input name="a" type="text" value="<?=$_POST['a'];?>" /></td> <td><input name="b" type="text" value="<?=$_POST['b'];?>"/></td> </tr> <tr> <td>Revenus de dividende (réel) :</td> <td><input name="c" type="text" value="<?=$_POST['c'];?>" /></td> <td><input name="d" type="text" value="<?=$_POST['d'];?>" /></td> </tr> <tr> <td>Revenus d'intérêts :</td> <td><input name="e" type="text" value="<?=$_POST['e'];?>" /></td> <td><input name="f" type="text" value="<?=$_POST['f'];?>" /></td> </tr> <tr> <td>Autres Revenus :</td> <td><label> <input type="text" name="g"/> </label></td> <td><input name="h" type="text" /></td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3"><span class="style1">Déductions</span></td> </tr> <tr> <td>RRQ</td> <td><input type="text" name="i" value="<?=$_POST['i'];?>"/></td> <td bgcolor="#999999"> </td> </tr> <tr> <td>REER</td> <td><input type="text" name="j" value="<?=$_POST['j'];?>"/></td> <td><input name="k" type="text" value="<?=$_POST['k'];?>" /></td> </tr> <tr> <td>Autres déductions</td> <td><input type="text" name="l" value="<?=$_POST['l'];?>"/></td> <td><input name="m" type="text" value="<?=$_POST['m'];?>" /></td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3"><span class="style1">CRÉDITS NON REMBOURSABLES</span></td> </tr> <tr> <td>Montant personnel de Base</td> <td><div align="right">10455</div></td> <td><div align="right">10375</div></td> </tr> <tr> <td>Montant en raison de l'age (6 658$)</td> <td colspan="2"><label> Plus de 65 ans</label></td> </tr> <tr> <td>RRQ</td> <td><input type="text" name="n" value="<?=$_POST['n'];?>"/></td> <td bgcolor="#999999"> </td> </tr> <tr> <td>Cotisation assurance emploi</td> <td><input type="text" name="o" value="<?=$_POST['o'];?>"/></td> <td><input type="text" name="p" value="<?=$_POST['p'];?>"/></td> </tr> <tr> <td>Autres Montants</td> <td><input type="text" name="q" value="<?=$_POST['q'];?>"/></td> <td><input type="text" name="r" value="<?=$_POST['r'];?>"/></td> </tr> <tr> <td colspan="3"> </td> </tr>
merci de ta réponse. J'ai essayé mais mon code ne fonctionne pas. si cela peux aider le voici (en partie)
if(!preg_match("#^[0-9]+$#", $_POST['a']) || !preg_match("#^[0-9]+$#", $_POST['b']) || !preg_match("#^[0-9]+$#", $_POST['c']) || !preg_match("#^[0-9]+$#", $_POST['d']) || !preg_match("#^[0-9]+$#", $_POST['e']) || !preg_match("#^[0-9]+$#", $_POST['f']) || !preg_match("#^[0-9]+$#", $_POST['g']) || !preg_match("#^[0-9]+$#", $_POST['h']) || !preg_match("#^[0-9]+$#", $_POST['i']) || !preg_match("#^[0-9]+$#", $_POST['j']) || !preg_match("#^[0-9]+$#", $_POST['k']) || !preg_match("#^[0-9]+$#", $_POST['l']) || !preg_match("#^[0-9]+$#", $_POST['m']) || !preg_match("#^[0-9]+$#", $_POST['n']) || !preg_match("#^[0-9]+$#", $_POST['o']) || !preg_match("#^[0-9]+$#", $_POST['p']) || !preg_match("#^[0-9]+$#", $_POST['q']) || !preg_match("#^[0-9]+$#", $_POST['r'])) { ?> <Form>[...]</Form> <?php } else { $s=($_POST['a']+$_POST['c']+$_POST['e']+$_POST['g']); echo 'Revenu total (Provincial) :'.$s'$'; $t=($_POST['b']+$_POST['d']+$_POST['f']+$_POST['h']); echo 'Revenu total (Fédéral) :'.$t'$'; $u=($_POST['i']+$_POST['j']+$_POST['l']); echo 'Déductions totales (Provincial) :'.$u'$'; $v=($_POST['k']+$_POST['m']); echo 'Déductions totales (Fédéral) :'.$v; $w=($_POST['s']-$_POST['u']); echo 'Revenu imposable (Provincial) :'.$w'$'; $x=($_POST['t']-$_POST['v']); echo 'Revenu imposable (Fédéral) :'.$x'$'; $y=(($_POST['n']+$_POST['o']+$_POST['q']+10375)*0.15); echo 'Crédits d\'impôts non remboursables (Provincial) :'.$y'$'; $z=(($_POST['p']+$_POST['r']+10455)*0.2); echo 'Crédits d\'impôts non remboursables (Fédéral) :'.$z'$'; if($_POST['w']>76770) { $aa=($_POST['w']*0.24); echo 'Impôt sur le revenu imposable (Provincial) :'.$aa'$'; } elseif(38 385<$_POST['w']<=76770) { $aa=($_POST['w']*0.20); echo 'Impôt sur le revenu imposable (Provincial) :'.$aa'$'; } else { $aa=($_POST['w']*0.16); echo 'Impôt sur le revenu imposable (Provincial) :'.$aa'$'; } if($_POST['w']>123264) { $bb=$_POST['w']*0.29; echo 'Impôt sur le revenu imposable (Fédéral) :'.$bb'$'; } elseif(82399<$_POST['w']<=126264) { $bb=$_POST(['w']*0.26); echo 'Impôt sur le revenu imposable (Fédéral) :'.$bb'$'; } elseif(41200<$_POST['w']<=82399) { $bb=($_POST['w']*0.22); echo 'Impôt sur le revenu imposable (Fédéral) :'.$bb'$'; } else { $bb=($_POST['w']*0.15); echo 'Impôt sur le revenu imposable (Fédéral) :'.$bb'$'; } $cc=($_POST['u']*0.1); echo 'Crédits d\'impôts pour dividendes (Provincial) :'.$cc'$'; $dd=($_POST['v']*1.25*0.1333); echo 'Crédits d\'impôts pour dividendes (Fédéral) :'.$dd'$'; $ee=($_POST['aa']-$_POST['y']-$_POST['cc']); echo '______________________________________'; echo 'Impôts à payer (provincial) :'.$ee'$'; $ff=($_POST['bb']-$_POST['z']-$_POST['dd']); echo 'Impôts à payer (Fédéral) :'.$ff'$'; echo '______________________________________'; } ?>
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
Qu'est ce qui ne marche pas ? Tu as un message d'erreur ?
A quel niveau du script ça ne marche pas (quelle condition).
A quel niveau du script ça ne marche pas (quelle condition).
En fait ma page apparaît blanche lorsque je la met sur le serveur...par contre il n'affiche aucun message d'erreur
ça marche!!! merci Benvii
un seul petit problème quand je clique sur calculer, le formulaire se reset...probablement un petit problème de code de ma part...
Merci
un seul petit problème quand je clique sur calculer, le formulaire se reset...probablement un petit problème de code de ma part...
Merci
C'est normal il faut que tu remettres les valeurs par exemple :
<input type="text" value="<?=$variable;?>">
= c'est comme echo.
<input type="text" value="<?=$variable;?>">
= c'est comme echo.
je ne suis pas sûr de comprendre... en fait, le formulaire se reset mais il n'affiche pas les réponses
Tu peux me donner le code du formulaire (partie HTML) ?
Es-que les données sont bien transmissent (réceptionné avec le tableau $_POST) ?
Es-que les données sont bien transmissent (réceptionné avec le tableau $_POST) ?
alors je te montre mon code...enocre une fois merci, je ne sais pas ce que je ferais sans ton aide
<!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Untitled Document</title> <style type="text/css"> <!-- .style1 { font-size: 18px; font-weight: bold; } --> </style> </head> <body> <p>Calcul de l'impôt personnel 2009 <? if(!preg_match("#^[0-9]+$#", $_POST['a']) || !preg_match("#^[0-9]+$#", $_POST['b']) || !preg_match("#^[0-9]+$#", $_POST['c']) || !preg_match("#^[0-9]+$#", $_POST['d']) || !preg_match("#^[0-9]+$#", $_POST['e']) || !preg_match("#^[0-9]+$#", $_POST['f']) || !preg_match("#^[0-9]+$#", $_POST['g']) || !preg_match("#^[0-9]+$#", $_POST['h']) || !preg_match("#^[0-9]+$#", $_POST['i']) || !preg_match("#^[0-9]+$#", $_POST['j']) || !preg_match("#^[0-9]+$#", $_POST['k']) || !preg_match("#^[0-9]+$#", $_POST['l']) || !preg_match("#^[0-9]+$#", $_POST['m']) || !preg_match("#^[0-9]+$#", $_POST['n']) || !preg_match("#^[0-9]+$#", $_POST['o']) || !preg_match("#^[0-9]+$#", $_POST['p']) || !preg_match("#^[0-9]+$#", $_POST['q']) || !preg_match("#^[0-9]+$#", $_POST['r'])) { ?> </p> <form method="post" action=""> <table width="746" border="1"> <tr> <td width="336"><span class="style1">Revenus</span></td> <td width="194">Provincial (Québec)</td> <td width="194">Fédéral</td> </tr> <tr> <td>Revenus de salaire : </td> <td><input name="a" type="text" /></td> <td><input name="b" type="text" /></td> </tr> <tr> <td>Revenus de dividende (réel) :</td> <td><input name="c" type="text" /></td> <td><input name="d" type="text" /></td> </tr> <tr> <td>Revenus d'intérêts :</td> <td><input name="e" type="text" /></td> <td><input name="f" type="text" /></td> </tr> <tr> <td>Autres Revenus :</td> <td><label> <input type="text" name="g"/> </label></td> <td><input name="h" type="text" /></td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3"><span class="style1">Déductions</span></td> </tr> <tr> <td>RRQ</td> <td><input type="text" name="i"/></td> <td bgcolor="#999999"> </td> </tr> <tr> <td>REER</td> <td><input type="text" name="j"/></td> <td><input name="k" type="text" /></td> </tr> <tr> <td>Autres déductions</td> <td><input type="text" name="l"/></td> <td><input name="m" type="text" /></td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3"><span class="style1">CRÉDITS NON REMBOURSABLES</span></td> </tr> <tr> <td>Montant personnel de Base</td> <td><div align="right">10455</div></td> <td><div align="right">10375</div></td> </tr> <tr> <td>Montant en raison de l'age (6 658$)</td> <td colspan="2"><label> Plus de 65 ans</label></td> </tr> <tr> <td>RRQ</td> <td><input type="text" name="n"/></td> <td bgcolor="#999999"> </td> </tr> <tr> <td>Cotisation assurance emploi</td> <td><input type="text" name="o"/></td> <td><input type="text" name="p"/></td> </tr> <tr> <td>Autres Montants</td> <td><input type="text" name="q"/></td> <td><input type="text" name="r"/></td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3"><input type="submit" method="Post" value="Calculer"/> <?php } else { $s=($_POST['a']+$_POST['c']+$_POST['e']+$_POST['g']); echo 'Revenu total (Provincial) :'.$s.'$'; $t=($_POST['b']+$_POST['d']+$_POST['f']+$_POST['h']); echo 'Revenu total (Fédéral) :'.$t.'$'; $u=($_POST['i']+$_POST['j']+$_POST['l']); echo 'Déductions totales (Provincial) :'.$u.'$'; $v=($_POST['k']+$_POST['m']); echo 'Déductions totales (Fédéral) :'.$v; $w=($_POST['s']-$_POST['u']); echo 'Revenu imposable (Provincial) :'.$w.'$'; $x=($_POST['t']-$_POST['v']); echo 'Revenu imposable (Fédéral) :'.$x.'$'; $y=(($_POST['n']+$_POST['o']+$_POST['q']+10375)*0.15); echo 'Crédits d\'impôts non remboursables (Provincial) :'.$y.'$'; $z=(($_POST['p']+$_POST['r']+10455)*0.2); echo 'Crédits d\'impôts non remboursables (Fédéral) :'.$z.'$'; if($_POST['w']>76770) { $aa=($_POST['w']*0.24); echo 'Impôt sur le revenu imposable (Provincial) :'.$aa.'$'; } elseif(38385<$_POST['w'] && $_POST['w']<=76770) { $aa=($_POST['w']*0.20); echo 'Impôt sur le revenu imposable (Provincial) :'.$aa.'$'; } else { $aa=($_POST['w']*0.16); echo 'Impôt sur le revenu imposable (Provincial) :'.$aa.'$'; } if($_POST['w']>123264) { $bb=$_POST['w']*0.29; echo 'Impôt sur le revenu imposable (Fédéral) :'.$bb.'$'; } elseif(82399<$_POST['w'] && $_POST['w']<=126264) { $bb=($_POST['w']*0.26); echo 'Impôt sur le revenu imposable (Fédéral) :'.$bb.'$'; } elseif(41200<$_POST['w'] && $_POST['w']<=82399) { $bb=($_POST['w']*0.22); echo 'Impôt sur le revenu imposable (Fédéral) :'.$bb.'$'; } else { $bb=($_POST['w']*0.15); echo 'Impôt sur le revenu imposable (Fédéral) :'.$bb.'$'; } $cc=($_POST['u']*0.1); echo 'Crédits d\'impôts pour dividendes (Provincial) :'.$cc.'$'; $dd=($_POST['v']*1.25*0.1333); echo 'Crédits d\'impôts pour dividendes (Fédéral) :'.$dd.'$'; $ee=($_POST['aa']-$_POST['y']-$_POST['cc']); echo '______________________________________'; echo 'Impôts à payer (provincial) :'.$ee.'$'; $ff=($_POST['bb']-$_POST['z']-$_POST['dd']); echo 'Impôts à payer (Fédéral) :'.$ff.'$'; echo '______________________________________'; } ?></td> </tr> </table> </form> <form id="form1" name="form1" method="post" action=""> <input type="submit" name="button2" id="button2" value="Remise à Zéro " /> </form> </body> </html>
alors je te montre mon code...enocre une fois merci, je ne sais pas ce que je ferais sans ton aide
<!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Untitled Document</title> <style type="text/css"> <!-- .style1 { font-size: 18px; font-weight: bold; } --> </style> </head> <body> <p>Calcul de l'impôt personnel 2009 <? if(!preg_match("#^[0-9]+$#", $_POST['a']) || !preg_match("#^[0-9]+$#", $_POST['b']) || !preg_match("#^[0-9]+$#", $_POST['c']) || !preg_match("#^[0-9]+$#", $_POST['d']) || !preg_match("#^[0-9]+$#", $_POST['e']) || !preg_match("#^[0-9]+$#", $_POST['f']) || !preg_match("#^[0-9]+$#", $_POST['g']) || !preg_match("#^[0-9]+$#", $_POST['h']) || !preg_match("#^[0-9]+$#", $_POST['i']) || !preg_match("#^[0-9]+$#", $_POST['j']) || !preg_match("#^[0-9]+$#", $_POST['k']) || !preg_match("#^[0-9]+$#", $_POST['l']) || !preg_match("#^[0-9]+$#", $_POST['m']) || !preg_match("#^[0-9]+$#", $_POST['n']) || !preg_match("#^[0-9]+$#", $_POST['o']) || !preg_match("#^[0-9]+$#", $_POST['p']) || !preg_match("#^[0-9]+$#", $_POST['q']) || !preg_match("#^[0-9]+$#", $_POST['r'])) { ?> </p> <form method="post" action=""> <table width="746" border="1"> <tr> <td width="336"><span class="style1">Revenus</span></td> <td width="194">Provincial (Québec)</td> <td width="194">Fédéral</td> </tr> <tr> <td>Revenus de salaire : </td> <td><input name="a" type="text" /></td> <td><input name="b" type="text" /></td> </tr> <tr> <td>Revenus de dividende (réel) :</td> <td><input name="c" type="text" /></td> <td><input name="d" type="text" /></td> </tr> <tr> <td>Revenus d'intérêts :</td> <td><input name="e" type="text" /></td> <td><input name="f" type="text" /></td> </tr> <tr> <td>Autres Revenus :</td> <td><label> <input type="text" name="g"/> </label></td> <td><input name="h" type="text" /></td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3"><span class="style1">Déductions</span></td> </tr> <tr> <td>RRQ</td> <td><input type="text" name="i"/></td> <td bgcolor="#999999"> </td> </tr> <tr> <td>REER</td> <td><input type="text" name="j"/></td> <td><input name="k" type="text" /></td> </tr> <tr> <td>Autres déductions</td> <td><input type="text" name="l"/></td> <td><input name="m" type="text" /></td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3"><span class="style1">CRÉDITS NON REMBOURSABLES</span></td> </tr> <tr> <td>Montant personnel de Base</td> <td><div align="right">10455</div></td> <td><div align="right">10375</div></td> </tr> <tr> <td>Montant en raison de l'age (6 658$)</td> <td colspan="2"><label> Plus de 65 ans</label></td> </tr> <tr> <td>RRQ</td> <td><input type="text" name="n"/></td> <td bgcolor="#999999"> </td> </tr> <tr> <td>Cotisation assurance emploi</td> <td><input type="text" name="o"/></td> <td><input type="text" name="p"/></td> </tr> <tr> <td>Autres Montants</td> <td><input type="text" name="q"/></td> <td><input type="text" name="r"/></td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3"><input type="submit" method="Post" value="Calculer"/> <?php } else { $s=($_POST['a']+$_POST['c']+$_POST['e']+$_POST['g']); echo 'Revenu total (Provincial) :'.$s.'$'; $t=($_POST['b']+$_POST['d']+$_POST['f']+$_POST['h']); echo 'Revenu total (Fédéral) :'.$t.'$'; $u=($_POST['i']+$_POST['j']+$_POST['l']); echo 'Déductions totales (Provincial) :'.$u.'$'; $v=($_POST['k']+$_POST['m']); echo 'Déductions totales (Fédéral) :'.$v; $w=($_POST['s']-$_POST['u']); echo 'Revenu imposable (Provincial) :'.$w.'$'; $x=($_POST['t']-$_POST['v']); echo 'Revenu imposable (Fédéral) :'.$x.'$'; $y=(($_POST['n']+$_POST['o']+$_POST['q']+10375)*0.15); echo 'Crédits d\'impôts non remboursables (Provincial) :'.$y.'$'; $z=(($_POST['p']+$_POST['r']+10455)*0.2); echo 'Crédits d\'impôts non remboursables (Fédéral) :'.$z.'$'; if($_POST['w']>76770) { $aa=($_POST['w']*0.24); echo 'Impôt sur le revenu imposable (Provincial) :'.$aa.'$'; } elseif(38385<$_POST['w'] && $_POST['w']<=76770) { $aa=($_POST['w']*0.20); echo 'Impôt sur le revenu imposable (Provincial) :'.$aa.'$'; } else { $aa=($_POST['w']*0.16); echo 'Impôt sur le revenu imposable (Provincial) :'.$aa.'$'; } if($_POST['w']>123264) { $bb=$_POST['w']*0.29; echo 'Impôt sur le revenu imposable (Fédéral) :'.$bb.'$'; } elseif(82399<$_POST['w'] && $_POST['w']<=126264) { $bb=($_POST['w']*0.26); echo 'Impôt sur le revenu imposable (Fédéral) :'.$bb.'$'; } elseif(41200<$_POST['w'] && $_POST['w']<=82399) { $bb=($_POST['w']*0.22); echo 'Impôt sur le revenu imposable (Fédéral) :'.$bb.'$'; } else { $bb=($_POST['w']*0.15); echo 'Impôt sur le revenu imposable (Fédéral) :'.$bb.'$'; } $cc=($_POST['u']*0.1); echo 'Crédits d\'impôts pour dividendes (Provincial) :'.$cc.'$'; $dd=($_POST['v']*1.25*0.1333); echo 'Crédits d\'impôts pour dividendes (Fédéral) :'.$dd.'$'; $ee=($_POST['aa']-$_POST['y']-$_POST['cc']); echo '______________________________________'; echo 'Impôts à payer (provincial) :'.$ee.'$'; $ff=($_POST['bb']-$_POST['z']-$_POST['dd']); echo 'Impôts à payer (Fédéral) :'.$ff.'$'; echo '______________________________________'; } ?></td> </tr> </table> </form> <form id="form1" name="form1" method="post" action=""> <input type="submit" name="button2" id="button2" value="Remise à Zéro " /> </form> </body> </html>
ps il y a un autre formulaire qui submit mais il agit comme reset pcq c'est la seule facon que j'ai trouver de revenir au début
ah une dernière petite chose.....comme si c'était pas assez...quand les résultats s'affichent comment faire pour ne pas qu'ils soient tous sur la même ligne j'aimerais qu'ils apparaissent chacun sur leur propre ligne