Bonjour
Je suis un débutant php, je fais un projet côté syntaxe aucun problème mais quand j'essaie d'envoyer les données de mon formulaire j'obtient toujours une erreur forbiden,wamp est par défaut et voici mon code.
J'arrive à accéder à phpmyadmin sans problème aucun,merci de bien vouloir m'aider car cela me fait vraiment stagner et je ne comprend absolument pas d'où viendrait l'erreur (j'ai déjà lu la doc apache)
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92 <html> <head><title>Ajout de nouveaux clients</title></head> <body bgcolor ="silver"> <script language="javascript"> function verif() { messsage=""; if(document.nvClient.nomClient.value=='') { messsage=messsage+"\n-Nom manquant"; } if(document.nvClient.raisonClient.value=='') { messsage=messsage+"\n-Raison sociale manquante"; } if(document.nvClient.adresseClient.value=='') { messsage=messsage+"\n-Adresse manquante"; } if(document.nvClient.telephone.value=='') { messsage=messsage+"\n-Telephone manquant"; } if(messsage!='') { alert("A completer :"+messsage); return false; } else{return true;} } </script> <?php if (isset($_POST['nomClient']) and isset($_POST['cinClient']) and isset($_POST['raisonClient']) and isset($_POST['adresseClient']) and isset($_POST['telephone'])) { // connexion à la base //require "connexion.php"; mysql_connect("localhost", "root", "secret"); mysql_select_db("abdelilah"); $nomClient = mysql_real_escape_string(htmlspecialchars($_POST['nomClient'])); $cinClient = mysql_real_escape_string(htmlspecialchars($_POST['cinClient'])); $raisonClient = mysql_real_escape_string(htmlspecialchars($_POST['raisonClient'])); $adresseClient = mysql_real_escape_string(htmlspecialchars($_POST['adresseClient'])); $telephone = mysql_real_escape_string(htmlspecialchars($_POST['telephone'])); mysql_query("INSERT INTO client VALUES('', '$nomClient', '$cinClient', '$raisonClient', '$adresseClient', '$telephone' )") or die(mysql_error()); //echo "voici le nom $nomClient " ; } else { // connexion à la base //require "connexion.php"; mysql_connect("localhost", "root", "secret"); mysql_select_db("abdelilah"); //formulaire de saisie des coordoonées //début formulaire echo '<div> <form name="nvClient" type="post" action="<?php echo $PHP_SELF?>" onSubmit="return verif()"> <p>Coordonnées du nouveau client</p><br> <ALIGN=LEFT><td><bgcolor="silver">Nom client</td>               <input type="text" name="nomClient" /></br></br> <ALIGN=LEFT>Cin (si existant)        <input type="text" name="cinClient" /></br></br> <ALIGN=LEFT>Raison sociale          <input type="text" name="raisonClient" /></br></br> <ALIGN=LEFT>Adresse                   <input type="text" name="adresseClient" /></br></br> <ALIGN=LEFT>Téléphone                <input type="text" name="telephone" /></br></br> <p align="LEFT"><input type="submit" value="Envoyer"> </form> </div>'; //fin formulaire } ?> </body> </html>
merci d'avance.
Partager