Architecture de données et formulaire
Bonjour et merci,
Qu'il y ait qlqchose ou non n'importe pas.
Le code doit prévoir les 2 situations non ?
Code:
1 2
|
value="<?php if (isset($_POST[$field['nom']])) echo $_POST[$field['nom']]; ?>" |
La version non adapté le prévoit aussi..... alors
J'ai essayé ta/la syntaxe suivante
Code:
1 2 3
|
<td width="163">
805 ==> <input type="text" name="<?php $field["nom"] ?> maxlength="32" value="<?php if (isset($_POST[$field['nom']])) echo $_POST[$field['nom']]; ?>" /> |
Mais je retrouve dans le log:
Code:
1 2
| [28-May-2010 10:12:36] PHP Notice: Undefined variable: field in F:\WebSites\test\checkform.php on line 804
[28-May-2010 10:12:36] PHP Notice: Undefined variable: field in F:\WebSites\test\checkform.php on line 804 |
Tu me diras que je peux ajouter
Code:
1 2
|
<?php $field = array() ?> |
en début de page HTML
Mais à ce moment j'ai dans le log:
Code:
1 2
| [28-May-2010 10:16:33] PHP Notice: Undefined index: nom in F:\WebSites\test\checkform.php on line 805
[28-May-2010 10:16:33] PHP Notice: Undefined index: nom in F:\WebSites\test\checkform.php on line 805 |
Le condition d'existence de la variable n'est pas testée.???
Dur dir la vie d'artiste :aie:
Ceci pas en compil maisj pb d'ecxécution
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
| <form action="<?php $_SERVER['PHP_SELF']; ?>" method="post" name="$curr['test']">
<table width="615" border="0">
<tr>
<td> </td>
<td colspan="6"><div align="center" class="style1">Validation de votre formulaire </div></td>
<td> </td>
</tr>
<tr>
<td colspan="8"><hr /></td>
</tr>
<tr>
<td width="60">Prenom</td>
<td colspan="3">
<input type="text" name="$curr['test']['prenom']" maxlength="32"
value="<?php if (isset($_POST[ $curr['test']['prenom'] ])) echo $_POST[ $curr['test' ]['prenom'] ] ?> "/>
</td>
<td width="127" align="center">Nom</td>
<td width="149">
<input type="text" name="$curr['test']['nom']" maxlength="32"
value="<?php if (isset($_POST[ $curr['test']['prenom'] ])) echo $_POST[ $curr['test' ]['prenom'] ] ?> "/>
</td>
<td width="46"> </td>
<td width="62"> </td>
</tr>
<tr>
<td><input type="reset" name="effacer" value="Effacer"/></td>
<td colspan="6" align="center">
<input type="text" size=60 name="$cur['test']['message']" readonly
value="<?php if (isset($_POST[ $curr['test']['message'] ])) echo $_POST[ $curr['test' ]['message'] ] ?>" /> </td>
<td><input type="submit" name="SUBMIT" value="Envoyer"/></td>
</tr>
</table>
</form> |