Bonsoir,
Voila je suis entrain de développer un site web et j'ai un problème lors d’exécution de ma requête d'insertion de messages.
j'ai une page contact.php qui contient un formulaire d'insertion de messages. ci dessous le code:
lorsque je clique sur le bouton send il m'affiche le message d'erreur.
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74 <?php require("_connex.php"); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <link rel="stylesheet" href="styles/style.css" type="text/css"> ..... ..... ..... <?php if(isset($_POST['nom']) && isset($_POST['prenom']) && isset($_POST['email']) && isset($_POST['msg']) && isset($_POST['msg'])){ $nm=$_POST["nom"]; $pr=$_POST["prenom"]; $aff=$_POST["affiliation"]; $mail=$_POST["email"]; $mg=$_POST["msg"]; $date = date("Y-m-d")." ".date("H:i:s"); $req="INSERT INTO contact(code,nom,prenom,affiliation,mail,message) VALUES('','$nm','$pr','$aff','$mail','$mg')"; mysql_query("$req") or die("Impossible d'éxécuter la requete"); echo "<h2>"."Votre message a été correcteement enregistrer"."</h2>"; } ?> <table cellspacing="10"> <form name="form2" id="form2" action="index.php?id=8" method="POST"> <tbody> <tr> <td class="greenone"> <b>Last Name<span class="red">*</span></b></td> <td class="formular"> <input name="nom" id="nom" maxlength="50" class="formular" size="35" type="text"></td> </tr> <tr> <td class="greenone"> <b>First name<span class="red">*</span></b></td> <td class="formular"> <input name="prenom" id="prenom" maxlength="50" class="formular" size="35" type="text"></td> </tr> <tr> <td class="greenone"> <b>Affiliation<span class="red">*</span></b></td> <td class="formular"> <input name="affiliation" id="affiliation" maxlength="50" class="formular" size="35" type="text"></td> </tr> <tr> <td class="greenone"> <b>Email<span class="red">*</span></b></td> <td class="formular"> <input name="email" id="email" maxlength="50" class="formular" size="35" type="text"></td> </tr> <tr> <td class="greenone"> <b>Message<span class="red">*</span></b></td> <td class="formular"> <textarea name="msg" id="message" maxlength="50" class="formular" size="35" type="text"></textarea></td> </tr> <tr> <td colspan="2" class="greenone" align="center"> <br> <input value="Reset" type="reset"> <img src="images/chargeur4.gif" id="charge"><input id="button" value="Send" onclick="if(verifier()==true) afficher_inscription()" type="submit"> </td> </tr> </tbody></form></table>
Merci pour votre aide.
Partager