hallo mensen,
ik krijg het niet voor mekaar om met de onderstaande code de data weg te schrijven naar een database. misschien dat iemand mij kan vertellen wat hiervan de reden is ?
tevens heb ik hieronder de info over de tabel waarin het geschreven zou moeten worden:
http://www.server-arrow.nl/plaatje.jpg
ik krijg het niet voor mekaar om met de onderstaande code de data weg te schrijven naar een database. misschien dat iemand mij kan vertellen wat hiervan de reden is ?
PHP:
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <? include "include/config.php"; include "include/Schouwer_klantgegevens_boven.php"; $status = $_POST["status"]; if ($status == 1){ $Sofi_nr = $_POST["Sofi_nr"]; $Naam = $_POST["Naam"]; $Straatnaam = $_POST["Straatnaam"]; $huis_nr = $_POST["huis_nr"]; $postcode = $_POST["postcode"]; $woonplaats = $_POST["woonplaats"]; $tel_nr = $_POST["tel_nr"]; ?> <form action="schouwer_invoer.php" method="post"> <div align="center"> <h1>Bevestig Gegevens </h1> <p><em>Klantgegevens </em></p> <table width="20%" border="0"> <tr> <td width="51%"><label for="label">Sofinummer</label></td> <td width="49%"><input name="Sofi_nr" id="Sofi_nr" type="text" maxlength="255" value="<?php echo htmlentities($Sofi_nr); ?>" /></td> </tr> <tr> <td>Naam</td> <td><input name="Naam" id="Naam" type="text" maxlength="255" value="<?php echo htmlentities($Naam); ?>" /></td> </tr> <tr> <td>Straatnaam</td> <td><input name="Straatnaam" id="Straatnaam" type="text" maxlength="255" value="<?php echo htmlentities($Straatnaam); ?>" /></td> </tr> <tr> <td>Huisnummer</td> <td> <input name="huis_nr" id="huis_nr" type="text" maxlength="255" value="<?php echo htmlentities($huis_nr); ?>" /></td> </tr> <tr> <td>Postcode</td> <td> <input name="postcode" id="postcode" type="text" maxlength="255" value="<?php echo htmlentities($postcode); ?>" /></td> </tr> <tr> <td>Woonplaats</td> <td> <input name="woonplaats" id="woonplaats" type="text" maxlength="255" value="<?php echo htmlentities($woonplaats); ?>" /></td> </tr> <tr> <td>Telefoonnummer</td> <td> <input name="tel_nr" id="tel_nr" type="text" maxlength="255" value="<?php echo htmlentities($tel_nr); ?>" /></td> </tr> <tr> </table> <p> <input name="contact" type="submit" value="Verstuur" /> <input name="status" type="hidden" value="2" id="status"> </p> </div> </form> <? } if ($status == 0){ ?> <center> </h1> </div> <form name="form1" method="post" action=schouwer_invoer.php> <div align="center"> <h1>Gegevens invoer </h1> <p><em>Klantgegevens</em></p> <table width="20%" border="0" align="center"> <tr> <td width="15%"><div align="left">Sofinummer:</div></td> <td> <div align="left"> <input name="Sofi_nr" type="text" id="Sofi_nr"> </div></td> </tr> <tr> <td width="15%"><div align="left">Naam:</div></td> <td> <div align="left"> <input name="Naam" type="text" id="Naam"> </div></td> </tr> <tr> <td width="15%"><div align="left">Straatnaam:</div></td> <td> <div align="left"> <input name="Straatnaam" type="text" id="Straatnaam"> </div></td> </tr> <tr> <td width="15%"><div align="left">Huisnummer:</div></td> <td> <div align="left"> <input name="huis_nr" type="text" id="huis_nr"> </div></td> </tr> <tr> <td width="15%"><div align="left">Postcode:</div></td> <td> <div align="left"> <input name="postcode" type="text" id="postcode"> </div></td> </tr> <tr> <td width="15%"><div align="left">Woonplaats:</div></td> <td> <div align="left"> <input name="woonplaats" type="text" id="woonplaats"> </div></td> </tr> <tr> <td width="15%"><div align="left">Telefoonnummer:</div></td> <td> <div align="left"> <input name="tel_nr" type="text" id="tel_nr"> <input name="status" type="hidden" id="status" value="1"> </div></td> </tr> </table> <input name="Login" type="submit" id="Login" value="Invoeren"> </p> </div> </form> <? } if ($status == 2){ $q = "SELECT * FROM `Klantgegevens`"; $r = mysql_query($q) or die(mysql_error()); $Klant_nr = mysql_num_rows($r); $Klant_nr = $Klant_nr + 1; $gebruiker_klant = "INSERT INTO Klantgegevens (Klant_nr, Sofi_nr, Naam, Straatnaam, huis_nr, postcode, woonplaats, tel_nr) VALUES ('$Klant_nr', '$Sofi_nr', '$Naam', '$Straatnaam', '$huis_nr', '$postcode', '$woonplaats', '$tel_nr')"; $gebruiker_result_klant = mysql_query($gebruiker_klant); ?> <h1 align="center">De gegevens zijn ingevoerd</h1> <? } include"include/onder.php"; ?> </body> </html> |
tevens heb ik hieronder de info over de tabel waarin het geschreven zou moeten worden:
http://www.server-arrow.nl/plaatje.jpg