bonjour
mon problème est due au rsultat d'affichage, car quand je saisi las champs , ne s'affiche que les nom des champs et pas le contenu que j'ai tapé, le hic c'est que cela marche avec certains formulaires et pas avec d'autres.
exemple joint: le formulaire pour module et son code php
résultat:
code _ mod
intitul _ mod
coef_ mod
et aucun contenu.
Le code PHP (mod.php)
Code php : 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 $cod_mod=$_POST['cod_mod']; $intitul_mod=$_POST['intitul_mod']; $coef_mod=$_POST['coef_mod']; Echo "<br />cod_mod ".$cod_mod; Echo "<br />intitul_mod ".$intitul_mod; Echo "<br />coef_mod ".$coef_mod; $bd=mysql_connect('localhost','root','admin') or die ('connexion impossible'.mysql_error()); mysql_select_db('data',$bd) or die ('selection impossible'.mysql_error()); $sql="insert into module (cod_mod,intitul_mod,coef_mod) value ('$cod mod','$intitul mod','$coef mod')"; mysql_query($sql); mysql_close();
Code html : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 <form action="mod.php" method="post"> <fieldset> <legend>module</legend> <label for="nom">code mod:</label> <input id="nom" name="nom" type="texte" /><br /> <br /> <label for="nom">intitul mod:</label> <input id="nom" name="nom" type="texte" /><br /><br /> <label for="nom">coef mod:</label> <input id="nom" name="nom" type="texte" /><br /> <br /> <input id="controler" type="submit" value="ajouter" /> <br /> </fieldset> </form>







Répondre avec citation




Affichez votre code en couleurs : [CODE=php][/CODE] (bouton # de l'éditeur) et [C=php][/C]

Partager