$_GET werkt wel en $_POST blijft leeg
als ik $_GET gebruik werkt het netjes en word alles mee gegeven. Echter als ik $_POST gebruik dan blijft de array leeg.
Heb al de hele dag op internet gezocht maar niks werkt.
post_data_reading staat op on en heb de max vars verhoogd naar 60m.
Onderstaande is de volledige code. Let niet op de style opmaak, dit moet nog worden aangepast etc.
Alvast hartelijk dank voor de hulp.
Code (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
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
<?php
error_reporting(E_ALL); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<title>Welkom - <?php print($userRow['user_name']); echo $_POST['name']; ?> in het administratie gedeelte van MEC AUDIO</title>
<?php include "menu/script.php"; ?>
</head>
<body>
<div class="header">
<div class="left">
<label><a href="http://www.mecaudio.nl">MECAUDIO - Factuur - <?php echo $_POST['name']; ?> </a></label>
</div>
<div class="right">
<label><a href="logout.php?logout=true"><i class="glyphicon glyphicon-log-out"></i> Uitloggen</a></label>
</div>
</div>
<?php include "menu.php"; ?>
<div style="position: absolute; left: 249px; top: 209px; width: 259px; height: 47px; font-size: 24px;"><strong>Debiteur toevoegen</strong></div>
<div id="wb_Form1" style="position: absolute; left: 242px; top: 256px; width: 938px; height: 642px; z-index: 34;">
<form name="debiteur" method="POST" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" enctype="text/plain" id="Form1">
<div id="wb_Text1" style="position:absolute;left:9px;top:12px;width:110px;height:16px;z-index:0;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Naam</span></div>
<input type="text" id="name" style="position:absolute;left:152px;top:12px;width:198px;height:23px;line-height:23px;z-index:1;" name="name" value="">
<div id="wb_Text2" style="position:absolute;left:580px;top:12px;width:110px;height:16px;z-index:2;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Actief</span></div>
<select name="actief" size="1" id="actief" style="position:absolute;left:708px;top:12px;width:200px;height:25px;z-index:3;">
<option selected value="1">Ja</option>
<option value="0">Nee</option>
<option value="3">On Hold</option>
</select>
<div id="wb_Text3" style="position:absolute;left:9px;top:172px;width:110px;height:16px;z-index:4;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Adres</span></div>
<input type="text" id="adres" style="position:absolute;left:152px;top:172px;width:198px;height:23px;line-height:23px;z-index:5;" name="adres" value="">
<div id="wb_Text4" style="position:absolute;left:9px;top:209px;width:110px;height:16px;z-index:6;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Postcode</span></div>
<input type="text" id="postcode" style="position:absolute;left:152px;top:209px;width:198px;height:23px;line-height:23px;z-index:7;" name="postcode" value="">
<div id="wb_Text5" style="position:absolute;left:9px;top:248px;width:110px;height:16px;z-index:8;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Plaats</span></div>
<input type="text" id="plaats" style="position:absolute;left:152px;top:248px;width:198px;height:23px;line-height:23px;z-index:9;" name="plaats" value="">
<div id="wb_Text6" style="position:absolute;left:9px;top:283px;width:110px;height:16px;z-index:10;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Provincie</span></div>
<select name="provincie" size="1" id="provincie" style="position:absolute;left:152px;top:283px;width:200px;height:25px;z-index:11;">
<option selected value="nh">Noord-holland</option>
<option value="zh">Zuid-holland</option>
<option value="zee">Zeeland</option>
<option value="fl">Flevoland</option>
<option value="ut">Utrecht</option>
<option value="nb">Noord-branbant</option>
<option value="fr">Friesland</option>
<option value="gr">Groningen</option>
<option value="dr">Drenthe</option>
<option value="ov">Overijssel</option>
<option value="gel">Gelderland</option>
<option value="lim">Limburg</option>
</select>
<div id="wb_Text7" style="position:absolute;left:9px;top:315px;width:110px;height:16px;z-index:12;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Land</span></div>
<select name="land" size="1" id="land" style="position:absolute;left:152px;top:315px;width:200px;height:25px;z-index:13;">
<option selected value="nl">Nederland</option>
<option value="be">Belgie</option>
<option value="de">Duitsland</option>
</select>
<div id="wb_Text8" style="position:absolute;left:580px;top:324px;width:110px;height:16px;z-index:14;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Telefoon / Fax</span></div>
<input type="text" id="telefoon" style="position:absolute;left:708px;top:324px;width:198px;height:23px;line-height:23px;z-index:15;" name="telefoon" value="">
<div id="wb_Text9" style="position:absolute;left:580px;top:288px;width:110px;height:16px;z-index:16;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Internet</span></div>
<input type="text" id="internet" style="position:absolute;left:708px;top:288px;width:198px;height:23px;line-height:23px;z-index:17;" name="internet" value="">
<div id="wb_Text10" style="position:absolute;left:580px;top:248px;width:110px;height:16px;z-index:18;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">BTW nummer</span></div>
<input type="text" id="btw" style="position:absolute;left:708px;top:248px;width:198px;height:23px;line-height:23px;z-index:19;" name="btw" value="">
<div id="wb_Text11" style="position:absolute;left:580px;top:209px;width:110px;height:16px;z-index:20;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">KVK</span></div>
<input type="text" id="kvk" style="position:absolute;left:708px;top:209px;width:198px;height:23px;line-height:23px;z-index:21;" name="kvk" value="">
<div id="wb_Text12" style="position:absolute;left:580px;top:172px;width:110px;height:16px;z-index:22;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Particulier</span></div>
<input type="checkbox" id="partbed" name="partbed" value="1" style="position:absolute;left:649px;top:172px;z-index:23;">
<div id="wb_Text13" style="position:absolute;left:734px;top:172px;width:110px;height:16px;z-index:24;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Bedrijf</span></div>
<div id="wb_Text14" style="position:absolute;left:9px;top:47px;width:110px;height:16px;z-index:25;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Kortingpercentage</span></div>
<select name="korting" size="1" id="korting" style="position:absolute;left:152px;top:47px;width:200px;height:25px;z-index:26;">
<option value="5">5% korting</option>
<option value="10">10% korting</option>
<option value="15">15% korting</option>
<option value="20">20% korting</option>
<option value="25">25% korting</option>
<option value="30">30% korting</option>
<option selected value="0">Geen</option>
</select>
<div id="wb_Text15" style="position: absolute; left: 582px; top: 49px; width: 110px; height: 16px; z-index: 27; text-align: left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Betalingsconditie</span></div>
<select name="betconditie" size="1" id="betconditie" style="position:absolute;left:708px;top:47px;width:200px;height:25px;z-index:28;">
<option value="7">7 dagen</option>
<option value="14">14 dagen</option>
<option value="20">20 dagen</option>
<option value="30">30 dagen</option>
</select>
<input type="checkbox" id="partbed" name="partbed" value="0" style="position:absolute;left:795px;top:172px;z-index:29;">
<input type="text" id="email" style="position:absolute;left:708px;top:360px;width:198px;height:19px;line-height:19px;z-index:30;" name="email" value="">
<div id="wb_Text16" style="position:absolute;left:580px;top:360px;width:110px;height:16px;z-index:31;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">E-mail adres</span></div>
<textarea name="klantopmerking" id="klantopmerking" style="position:absolute;left:152px;top:416px;width:754px;height:165px;z-index:32;" rows="9" cols="122"></textarea>
<input type="submit" value="Opslaan" style="position: absolute; left: 824px; top: 600px; width: 81px; height: 25px; z-index: 57;" />
<input type="reset" size="12" value="Reset" style="position: absolute; left: 738px; top: 600px; width: 81px; height: 25px; z-index: 57;" />
<div id="wb_Text17" style="position:absolute;left:9px;top:416px;width:110px;height:32px;z-index:33;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Opmerkignen / Aantekeningen</span></div>
</form>
</div>
</body>
</html>
error_reporting(E_ALL); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<title>Welkom - <?php print($userRow['user_name']); echo $_POST['name']; ?> in het administratie gedeelte van MEC AUDIO</title>
<?php include "menu/script.php"; ?>
</head>
<body>
<div class="header">
<div class="left">
<label><a href="http://www.mecaudio.nl">MECAUDIO - Factuur - <?php echo $_POST['name']; ?> </a></label>
</div>
<div class="right">
<label><a href="logout.php?logout=true"><i class="glyphicon glyphicon-log-out"></i> Uitloggen</a></label>
</div>
</div>
<?php include "menu.php"; ?>
<div style="position: absolute; left: 249px; top: 209px; width: 259px; height: 47px; font-size: 24px;"><strong>Debiteur toevoegen</strong></div>
<div id="wb_Form1" style="position: absolute; left: 242px; top: 256px; width: 938px; height: 642px; z-index: 34;">
<form name="debiteur" method="POST" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" enctype="text/plain" id="Form1">
<div id="wb_Text1" style="position:absolute;left:9px;top:12px;width:110px;height:16px;z-index:0;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Naam</span></div>
<input type="text" id="name" style="position:absolute;left:152px;top:12px;width:198px;height:23px;line-height:23px;z-index:1;" name="name" value="">
<div id="wb_Text2" style="position:absolute;left:580px;top:12px;width:110px;height:16px;z-index:2;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Actief</span></div>
<select name="actief" size="1" id="actief" style="position:absolute;left:708px;top:12px;width:200px;height:25px;z-index:3;">
<option selected value="1">Ja</option>
<option value="0">Nee</option>
<option value="3">On Hold</option>
</select>
<div id="wb_Text3" style="position:absolute;left:9px;top:172px;width:110px;height:16px;z-index:4;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Adres</span></div>
<input type="text" id="adres" style="position:absolute;left:152px;top:172px;width:198px;height:23px;line-height:23px;z-index:5;" name="adres" value="">
<div id="wb_Text4" style="position:absolute;left:9px;top:209px;width:110px;height:16px;z-index:6;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Postcode</span></div>
<input type="text" id="postcode" style="position:absolute;left:152px;top:209px;width:198px;height:23px;line-height:23px;z-index:7;" name="postcode" value="">
<div id="wb_Text5" style="position:absolute;left:9px;top:248px;width:110px;height:16px;z-index:8;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Plaats</span></div>
<input type="text" id="plaats" style="position:absolute;left:152px;top:248px;width:198px;height:23px;line-height:23px;z-index:9;" name="plaats" value="">
<div id="wb_Text6" style="position:absolute;left:9px;top:283px;width:110px;height:16px;z-index:10;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Provincie</span></div>
<select name="provincie" size="1" id="provincie" style="position:absolute;left:152px;top:283px;width:200px;height:25px;z-index:11;">
<option selected value="nh">Noord-holland</option>
<option value="zh">Zuid-holland</option>
<option value="zee">Zeeland</option>
<option value="fl">Flevoland</option>
<option value="ut">Utrecht</option>
<option value="nb">Noord-branbant</option>
<option value="fr">Friesland</option>
<option value="gr">Groningen</option>
<option value="dr">Drenthe</option>
<option value="ov">Overijssel</option>
<option value="gel">Gelderland</option>
<option value="lim">Limburg</option>
</select>
<div id="wb_Text7" style="position:absolute;left:9px;top:315px;width:110px;height:16px;z-index:12;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Land</span></div>
<select name="land" size="1" id="land" style="position:absolute;left:152px;top:315px;width:200px;height:25px;z-index:13;">
<option selected value="nl">Nederland</option>
<option value="be">Belgie</option>
<option value="de">Duitsland</option>
</select>
<div id="wb_Text8" style="position:absolute;left:580px;top:324px;width:110px;height:16px;z-index:14;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Telefoon / Fax</span></div>
<input type="text" id="telefoon" style="position:absolute;left:708px;top:324px;width:198px;height:23px;line-height:23px;z-index:15;" name="telefoon" value="">
<div id="wb_Text9" style="position:absolute;left:580px;top:288px;width:110px;height:16px;z-index:16;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Internet</span></div>
<input type="text" id="internet" style="position:absolute;left:708px;top:288px;width:198px;height:23px;line-height:23px;z-index:17;" name="internet" value="">
<div id="wb_Text10" style="position:absolute;left:580px;top:248px;width:110px;height:16px;z-index:18;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">BTW nummer</span></div>
<input type="text" id="btw" style="position:absolute;left:708px;top:248px;width:198px;height:23px;line-height:23px;z-index:19;" name="btw" value="">
<div id="wb_Text11" style="position:absolute;left:580px;top:209px;width:110px;height:16px;z-index:20;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">KVK</span></div>
<input type="text" id="kvk" style="position:absolute;left:708px;top:209px;width:198px;height:23px;line-height:23px;z-index:21;" name="kvk" value="">
<div id="wb_Text12" style="position:absolute;left:580px;top:172px;width:110px;height:16px;z-index:22;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Particulier</span></div>
<input type="checkbox" id="partbed" name="partbed" value="1" style="position:absolute;left:649px;top:172px;z-index:23;">
<div id="wb_Text13" style="position:absolute;left:734px;top:172px;width:110px;height:16px;z-index:24;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Bedrijf</span></div>
<div id="wb_Text14" style="position:absolute;left:9px;top:47px;width:110px;height:16px;z-index:25;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Kortingpercentage</span></div>
<select name="korting" size="1" id="korting" style="position:absolute;left:152px;top:47px;width:200px;height:25px;z-index:26;">
<option value="5">5% korting</option>
<option value="10">10% korting</option>
<option value="15">15% korting</option>
<option value="20">20% korting</option>
<option value="25">25% korting</option>
<option value="30">30% korting</option>
<option selected value="0">Geen</option>
</select>
<div id="wb_Text15" style="position: absolute; left: 582px; top: 49px; width: 110px; height: 16px; z-index: 27; text-align: left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Betalingsconditie</span></div>
<select name="betconditie" size="1" id="betconditie" style="position:absolute;left:708px;top:47px;width:200px;height:25px;z-index:28;">
<option value="7">7 dagen</option>
<option value="14">14 dagen</option>
<option value="20">20 dagen</option>
<option value="30">30 dagen</option>
</select>
<input type="checkbox" id="partbed" name="partbed" value="0" style="position:absolute;left:795px;top:172px;z-index:29;">
<input type="text" id="email" style="position:absolute;left:708px;top:360px;width:198px;height:19px;line-height:19px;z-index:30;" name="email" value="">
<div id="wb_Text16" style="position:absolute;left:580px;top:360px;width:110px;height:16px;z-index:31;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">E-mail adres</span></div>
<textarea name="klantopmerking" id="klantopmerking" style="position:absolute;left:152px;top:416px;width:754px;height:165px;z-index:32;" rows="9" cols="122"></textarea>
<input type="submit" value="Opslaan" style="position: absolute; left: 824px; top: 600px; width: 81px; height: 25px; z-index: 57;" />
<input type="reset" size="12" value="Reset" style="position: absolute; left: 738px; top: 600px; width: 81px; height: 25px; z-index: 57;" />
<div id="wb_Text17" style="position:absolute;left:9px;top:416px;width:110px;height:32px;z-index:33;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Opmerkignen / Aantekeningen</span></div>
</form>
</div>
</body>
</html>
- Aar -:
Gelieve in het vervolg bij code de [code][/code]-tags gebruiken.
Hier kan je meer lezen over de mogelijke opmaakcodes.
Alvast bedankt!
Hier kan je meer lezen over de mogelijke opmaakcodes.
Alvast bedankt!
Gewijzigd op 08/07/2015 16:05:31 door - Ariën -
Notice: Undefined index: name in /var/www/vhosts/mecaudio.nl/httpdocs/administratie/debiteurmaken.php on line 18
Op een of andere manier geeft hij bij $_POST niets door.
Toevoeging op 08/07/2015 14:36:05:
Nee je ziet inderdaad geen $_GET aangezien ik het als zijnde &_POST wil laten werken, $_GET heb ik even als test geprobeerd en dan werkt het wel gewoon. Maar ik wil niets in mijn adres balk weergeven dus ik wil het als &_POST.
En als je de eerste keer op de pagina komt dan bestaat $_POST['name'] ook nog niet.
Verder kijk je nergens of er wel gepost is of (nog) niet.
En name="partbed" komt meer dan 1 keer voor.
Gewijzigd op 08/07/2015 14:45:57 door - SanThe -
De main part is dat $_POST niet werkt en &_GET wel $userRow['user_name'] word werkelijk gebruikt en werkt ook gewoon.
Code (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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
include_once 'dbconfig.php';
if(!$user->is_loggedin())
{
$user->redirect('index.php');
}
$user_id = $_SESSION['user_session'];
$stmt = $DB_con->prepare("SELECT * FROM users WHERE user_id=:user_id");
$stmt->execute(array(":user_id"=>$user_id));
$userRow=$stmt->fetch(PDO::FETCH_ASSOC);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<title>Welkom - <?php print($userRow['user_name']); ?> in het administratie gedeelte van MEC AUDIO</title>
<?php include "menu/script.php"; ?>
</head>
<?php
if ($_SERVER["REQUEST_METHOD"] == "GET") { //Bekijk of de server een POST request geeft
if ( ! empty( $_GET ) ) { // Bekijken of het form net leeg is
$postc = isset($_GET["postcode"]); // Opvragen postcode
$stmt = $DB_con->prepare("SELECT postcode FROM debiteuren WHERE postcode LIKE '$postc'"); // check db op postcode
$userRow=$stmt->fetch(PDO::FETCH_ASSOC); //Het pakken van de postcode
if ($userRow['postcode'] == '$postc') { // Vergelijk ppostcodes db op die van het formulier
echo "Helaas bestaat deze debiteur al"; // Bestaat deze al? dan deze melding weergeven
}
}
$stmt = $DB_con->prepare("INSERT INTO postcode (naam, adres, postcode, plaats, provincie, land, partbed, telefoon, email, actief, kvk, btw, betconditie, klantopmerking) VALUES ($name, $adres, $postcode, $plaats, $provincie, $land, $partbed, $telefoon, $email, $actief, $kvk, $btw, $betconditie, $klantopmerking)"); // Voorbereiden in databaseopslaan
// Parameters instellen om uit te voeren
$naam = isset($_GET["name"]);
$adres = isset($_GET["adres"]);
$postcode = isset($_GET["postcode"]);
$plaats = isset($_GET["plaats"]);
$provincie = isset($_GET["provincie"]);
$land = isset($_GET["land"]);
$partbed = isset($_GET["partbed"]);
$telefoon = isset($_GET["telefoon"]);
$email = isset($_GET["email"]);
$actief = isset($_GET["actief"]);
$kvk = isset($_GET["kvk"]);
$btw = isset($_GET["btw"]);
$betconditie = isset($_GET["bedconditie"]);
$klantopmerking = isset($_GET["klantopmerking"]);
$stmt->bindparam("ssssssssssssss", $naam, $adres, $postcode, $plaats, $provincie, $land, $partbed, $telefoon, $email, $actief, $kvk, $btw, $betconditie, $klantopmerking); // bind de waarden die zijn aangegeven
$stmt->execute();
echo "
<script type=\"text/javascript\">
<!--
window.alert('U heeft geen rechten voor deze pagina')
window.location.href='home.php';
// -->
</script>";
$stmt->close();
$DB_con->close();
}
else {
?>
<body>
<div class="header">
<div class="left">
<label><a href="http://www.mecaudio.nl">MECAUDIO - Factuur</a></label>
</div>
<div class="right">
<label><a href="logout.php?logout=true"><i class="glyphicon glyphicon-log-out"></i> Uitloggen</a></label>
</div>
</div>
<?php include "menu.php"; ?>
<div style="position: absolute; left: 249px; top: 209px; width: 259px; height: 47px; font-size: 24px;"><strong>Debiteur toevoegen</strong></div>
<div id="wb_Form1" style="position: absolute; left: 242px; top: 256px; width: 938px; height: 642px; z-index: 34;">
<form name="debiteur" method="GET" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" enctype="text/plain" id="Form1">
<div id="wb_Text1" style="position:absolute;left:9px;top:12px;width:110px;height:16px;z-index:0;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Naam</span></div>
<input type="text" id="name" style="position:absolute;left:152px;top:12px;width:198px;height:23px;line-height:23px;z-index:1;" name="name" value="">
<div id="wb_Text2" style="position:absolute;left:580px;top:12px;width:110px;height:16px;z-index:2;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Actief</span></div>
<select name="actief" size="1" id="actief" style="position:absolute;left:708px;top:12px;width:200px;height:25px;z-index:3;">
<option selected value="1">Ja</option>
<option value="0">Nee</option>
<option value="3">On Hold</option>
</select>
<div id="wb_Text3" style="position:absolute;left:9px;top:172px;width:110px;height:16px;z-index:4;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Adres</span></div>
<input type="text" id="adres" style="position:absolute;left:152px;top:172px;width:198px;height:23px;line-height:23px;z-index:5;" name="adres" value="">
<div id="wb_Text4" style="position:absolute;left:9px;top:209px;width:110px;height:16px;z-index:6;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Postcode</span></div>
<input type="text" id="postcode" style="position:absolute;left:152px;top:209px;width:198px;height:23px;line-height:23px;z-index:7;" name="postcode" value="">
<div id="wb_Text5" style="position:absolute;left:9px;top:248px;width:110px;height:16px;z-index:8;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Plaats</span></div>
<input type="text" id="plaats" style="position:absolute;left:152px;top:248px;width:198px;height:23px;line-height:23px;z-index:9;" name="plaats" value="">
<div id="wb_Text6" style="position:absolute;left:9px;top:283px;width:110px;height:16px;z-index:10;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Provincie</span></div>
<select name="provincie" size="1" id="provincie" style="position:absolute;left:152px;top:283px;width:200px;height:25px;z-index:11;">
<option selected value="nh">Noord-holland</option>
<option value="zh">Zuid-holland</option>
<option value="zee">Zeeland</option>
<option value="fl">Flevoland</option>
<option value="ut">Utrecht</option>
<option value="nb">Noord-branbant</option>
<option value="fr">Friesland</option>
<option value="gr">Groningen</option>
<option value="dr">Drenthe</option>
<option value="ov">Overijssel</option>
<option value="gel">Gelderland</option>
<option value="lim">Limburg</option>
</select>
<div id="wb_Text7" style="position:absolute;left:9px;top:315px;width:110px;height:16px;z-index:12;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Land</span></div>
<select name="land" size="1" id="land" style="position:absolute;left:152px;top:315px;width:200px;height:25px;z-index:13;">
<option selected value="nl">Nederland</option>
<option value="be">Belgie</option>
<option value="de">Duitsland</option>
</select>
<div id="wb_Text8" style="position:absolute;left:580px;top:324px;width:110px;height:16px;z-index:14;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Telefoon / Fax</span></div>
<input type="text" id="telefoon" style="position:absolute;left:708px;top:324px;width:198px;height:23px;line-height:23px;z-index:15;" name="telefoon" value="">
<div id="wb_Text9" style="position:absolute;left:580px;top:288px;width:110px;height:16px;z-index:16;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Internet</span></div>
<input type="text" id="internet" style="position:absolute;left:708px;top:288px;width:198px;height:23px;line-height:23px;z-index:17;" name="internet" value="">
<div id="wb_Text10" style="position:absolute;left:580px;top:248px;width:110px;height:16px;z-index:18;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">BTW nummer</span></div>
<input type="text" id="btw" style="position:absolute;left:708px;top:248px;width:198px;height:23px;line-height:23px;z-index:19;" name="btw" value="">
<div id="wb_Text11" style="position:absolute;left:580px;top:209px;width:110px;height:16px;z-index:20;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">KVK</span></div>
<input type="text" id="kvk" style="position:absolute;left:708px;top:209px;width:198px;height:23px;line-height:23px;z-index:21;" name="kvk" value="">
<div id="wb_Text12" style="position:absolute;left:580px;top:172px;width:110px;height:16px;z-index:22;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Particulier</span></div>
<input type="checkbox" id="partbed" name="partbed" value="1" style="position:absolute;left:649px;top:172px;z-index:23;">
<div id="wb_Text13" style="position:absolute;left:734px;top:172px;width:110px;height:16px;z-index:24;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Bedrijf</span></div>
<div id="wb_Text14" style="position:absolute;left:9px;top:47px;width:110px;height:16px;z-index:25;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Kortingpercentage</span></div>
<select name="korting" size="1" id="korting" style="position:absolute;left:152px;top:47px;width:200px;height:25px;z-index:26;">
<option value="5">5% korting</option>
<option value="10">10% korting</option>
<option value="15">15% korting</option>
<option value="20">20% korting</option>
<option value="25">25% korting</option>
<option value="30">30% korting</option>
<option selected value="0">Geen</option>
</select>
<div id="wb_Text15" style="position: absolute; left: 582px; top: 49px; width: 110px; height: 16px; z-index: 27; text-align: left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Betalingsconditie</span></div>
<select name="betconditie" size="1" id="betconditie" style="position:absolute;left:708px;top:47px;width:200px;height:25px;z-index:28;">
<option value="7">7 dagen</option>
<option value="14">14 dagen</option>
<option value="20">20 dagen</option>
<option value="30">30 dagen</option>
</select>
<input type="checkbox" id="partbed" name="partbed" value="0" style="position:absolute;left:795px;top:172px;z-index:29;">
<input type="text" id="email" style="position:absolute;left:708px;top:360px;width:198px;height:19px;line-height:19px;z-index:30;" name="email" value="">
<div id="wb_Text16" style="position:absolute;left:580px;top:360px;width:110px;height:16px;z-index:31;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">E-mail adres</span></div>
<textarea name="klantopmerking" id="klantopmerking" style="position:absolute;left:152px;top:416px;width:754px;height:165px;z-index:32;" rows="9" cols="122"></textarea>
<input type="submit" value="Opslaan" style="position: absolute; left: 824px; top: 600px; width: 81px; height: 25px; z-index: 57;" />
<input type="reset" size="12" value="Reset" style="position: absolute; left: 738px; top: 600px; width: 81px; height: 25px; z-index: 57;" />
<div id="wb_Text17" style="position:absolute;left:9px;top:416px;width:110px;height:32px;z-index:33;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Opmerkignen / Aantekeningen</span></div>
</form>
</div>
</body>
<?php } ?>
</html>
ini_set('display_errors', 1);
error_reporting(E_ALL);
include_once 'dbconfig.php';
if(!$user->is_loggedin())
{
$user->redirect('index.php');
}
$user_id = $_SESSION['user_session'];
$stmt = $DB_con->prepare("SELECT * FROM users WHERE user_id=:user_id");
$stmt->execute(array(":user_id"=>$user_id));
$userRow=$stmt->fetch(PDO::FETCH_ASSOC);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<title>Welkom - <?php print($userRow['user_name']); ?> in het administratie gedeelte van MEC AUDIO</title>
<?php include "menu/script.php"; ?>
</head>
<?php
if ($_SERVER["REQUEST_METHOD"] == "GET") { //Bekijk of de server een POST request geeft
if ( ! empty( $_GET ) ) { // Bekijken of het form net leeg is
$postc = isset($_GET["postcode"]); // Opvragen postcode
$stmt = $DB_con->prepare("SELECT postcode FROM debiteuren WHERE postcode LIKE '$postc'"); // check db op postcode
$userRow=$stmt->fetch(PDO::FETCH_ASSOC); //Het pakken van de postcode
if ($userRow['postcode'] == '$postc') { // Vergelijk ppostcodes db op die van het formulier
echo "Helaas bestaat deze debiteur al"; // Bestaat deze al? dan deze melding weergeven
}
}
$stmt = $DB_con->prepare("INSERT INTO postcode (naam, adres, postcode, plaats, provincie, land, partbed, telefoon, email, actief, kvk, btw, betconditie, klantopmerking) VALUES ($name, $adres, $postcode, $plaats, $provincie, $land, $partbed, $telefoon, $email, $actief, $kvk, $btw, $betconditie, $klantopmerking)"); // Voorbereiden in databaseopslaan
// Parameters instellen om uit te voeren
$naam = isset($_GET["name"]);
$adres = isset($_GET["adres"]);
$postcode = isset($_GET["postcode"]);
$plaats = isset($_GET["plaats"]);
$provincie = isset($_GET["provincie"]);
$land = isset($_GET["land"]);
$partbed = isset($_GET["partbed"]);
$telefoon = isset($_GET["telefoon"]);
$email = isset($_GET["email"]);
$actief = isset($_GET["actief"]);
$kvk = isset($_GET["kvk"]);
$btw = isset($_GET["btw"]);
$betconditie = isset($_GET["bedconditie"]);
$klantopmerking = isset($_GET["klantopmerking"]);
$stmt->bindparam("ssssssssssssss", $naam, $adres, $postcode, $plaats, $provincie, $land, $partbed, $telefoon, $email, $actief, $kvk, $btw, $betconditie, $klantopmerking); // bind de waarden die zijn aangegeven
$stmt->execute();
echo "
<script type=\"text/javascript\">
<!--
window.alert('U heeft geen rechten voor deze pagina')
window.location.href='home.php';
// -->
</script>";
$stmt->close();
$DB_con->close();
}
else {
?>
<body>
<div class="header">
<div class="left">
<label><a href="http://www.mecaudio.nl">MECAUDIO - Factuur</a></label>
</div>
<div class="right">
<label><a href="logout.php?logout=true"><i class="glyphicon glyphicon-log-out"></i> Uitloggen</a></label>
</div>
</div>
<?php include "menu.php"; ?>
<div style="position: absolute; left: 249px; top: 209px; width: 259px; height: 47px; font-size: 24px;"><strong>Debiteur toevoegen</strong></div>
<div id="wb_Form1" style="position: absolute; left: 242px; top: 256px; width: 938px; height: 642px; z-index: 34;">
<form name="debiteur" method="GET" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" enctype="text/plain" id="Form1">
<div id="wb_Text1" style="position:absolute;left:9px;top:12px;width:110px;height:16px;z-index:0;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Naam</span></div>
<input type="text" id="name" style="position:absolute;left:152px;top:12px;width:198px;height:23px;line-height:23px;z-index:1;" name="name" value="">
<div id="wb_Text2" style="position:absolute;left:580px;top:12px;width:110px;height:16px;z-index:2;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Actief</span></div>
<select name="actief" size="1" id="actief" style="position:absolute;left:708px;top:12px;width:200px;height:25px;z-index:3;">
<option selected value="1">Ja</option>
<option value="0">Nee</option>
<option value="3">On Hold</option>
</select>
<div id="wb_Text3" style="position:absolute;left:9px;top:172px;width:110px;height:16px;z-index:4;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Adres</span></div>
<input type="text" id="adres" style="position:absolute;left:152px;top:172px;width:198px;height:23px;line-height:23px;z-index:5;" name="adres" value="">
<div id="wb_Text4" style="position:absolute;left:9px;top:209px;width:110px;height:16px;z-index:6;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Postcode</span></div>
<input type="text" id="postcode" style="position:absolute;left:152px;top:209px;width:198px;height:23px;line-height:23px;z-index:7;" name="postcode" value="">
<div id="wb_Text5" style="position:absolute;left:9px;top:248px;width:110px;height:16px;z-index:8;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Plaats</span></div>
<input type="text" id="plaats" style="position:absolute;left:152px;top:248px;width:198px;height:23px;line-height:23px;z-index:9;" name="plaats" value="">
<div id="wb_Text6" style="position:absolute;left:9px;top:283px;width:110px;height:16px;z-index:10;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Provincie</span></div>
<select name="provincie" size="1" id="provincie" style="position:absolute;left:152px;top:283px;width:200px;height:25px;z-index:11;">
<option selected value="nh">Noord-holland</option>
<option value="zh">Zuid-holland</option>
<option value="zee">Zeeland</option>
<option value="fl">Flevoland</option>
<option value="ut">Utrecht</option>
<option value="nb">Noord-branbant</option>
<option value="fr">Friesland</option>
<option value="gr">Groningen</option>
<option value="dr">Drenthe</option>
<option value="ov">Overijssel</option>
<option value="gel">Gelderland</option>
<option value="lim">Limburg</option>
</select>
<div id="wb_Text7" style="position:absolute;left:9px;top:315px;width:110px;height:16px;z-index:12;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Land</span></div>
<select name="land" size="1" id="land" style="position:absolute;left:152px;top:315px;width:200px;height:25px;z-index:13;">
<option selected value="nl">Nederland</option>
<option value="be">Belgie</option>
<option value="de">Duitsland</option>
</select>
<div id="wb_Text8" style="position:absolute;left:580px;top:324px;width:110px;height:16px;z-index:14;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Telefoon / Fax</span></div>
<input type="text" id="telefoon" style="position:absolute;left:708px;top:324px;width:198px;height:23px;line-height:23px;z-index:15;" name="telefoon" value="">
<div id="wb_Text9" style="position:absolute;left:580px;top:288px;width:110px;height:16px;z-index:16;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Internet</span></div>
<input type="text" id="internet" style="position:absolute;left:708px;top:288px;width:198px;height:23px;line-height:23px;z-index:17;" name="internet" value="">
<div id="wb_Text10" style="position:absolute;left:580px;top:248px;width:110px;height:16px;z-index:18;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">BTW nummer</span></div>
<input type="text" id="btw" style="position:absolute;left:708px;top:248px;width:198px;height:23px;line-height:23px;z-index:19;" name="btw" value="">
<div id="wb_Text11" style="position:absolute;left:580px;top:209px;width:110px;height:16px;z-index:20;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">KVK</span></div>
<input type="text" id="kvk" style="position:absolute;left:708px;top:209px;width:198px;height:23px;line-height:23px;z-index:21;" name="kvk" value="">
<div id="wb_Text12" style="position:absolute;left:580px;top:172px;width:110px;height:16px;z-index:22;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Particulier</span></div>
<input type="checkbox" id="partbed" name="partbed" value="1" style="position:absolute;left:649px;top:172px;z-index:23;">
<div id="wb_Text13" style="position:absolute;left:734px;top:172px;width:110px;height:16px;z-index:24;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Bedrijf</span></div>
<div id="wb_Text14" style="position:absolute;left:9px;top:47px;width:110px;height:16px;z-index:25;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Kortingpercentage</span></div>
<select name="korting" size="1" id="korting" style="position:absolute;left:152px;top:47px;width:200px;height:25px;z-index:26;">
<option value="5">5% korting</option>
<option value="10">10% korting</option>
<option value="15">15% korting</option>
<option value="20">20% korting</option>
<option value="25">25% korting</option>
<option value="30">30% korting</option>
<option selected value="0">Geen</option>
</select>
<div id="wb_Text15" style="position: absolute; left: 582px; top: 49px; width: 110px; height: 16px; z-index: 27; text-align: left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Betalingsconditie</span></div>
<select name="betconditie" size="1" id="betconditie" style="position:absolute;left:708px;top:47px;width:200px;height:25px;z-index:28;">
<option value="7">7 dagen</option>
<option value="14">14 dagen</option>
<option value="20">20 dagen</option>
<option value="30">30 dagen</option>
</select>
<input type="checkbox" id="partbed" name="partbed" value="0" style="position:absolute;left:795px;top:172px;z-index:29;">
<input type="text" id="email" style="position:absolute;left:708px;top:360px;width:198px;height:19px;line-height:19px;z-index:30;" name="email" value="">
<div id="wb_Text16" style="position:absolute;left:580px;top:360px;width:110px;height:16px;z-index:31;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">E-mail adres</span></div>
<textarea name="klantopmerking" id="klantopmerking" style="position:absolute;left:152px;top:416px;width:754px;height:165px;z-index:32;" rows="9" cols="122"></textarea>
<input type="submit" value="Opslaan" style="position: absolute; left: 824px; top: 600px; width: 81px; height: 25px; z-index: 57;" />
<input type="reset" size="12" value="Reset" style="position: absolute; left: 738px; top: 600px; width: 81px; height: 25px; z-index: 57;" />
<div id="wb_Text17" style="position:absolute;left:9px;top:416px;width:110px;height:32px;z-index:33;text-align:left;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Opmerkignen / Aantekeningen</span></div>
</form>
</div>
</body>
<?php } ?>
</html>
- Aar -:
Gelieve in het vervolg bij code de [code][/code]-tags gebruiken.
Hier kan je meer lezen over de mogelijke opmaakcodes.
Alvast bedankt!
Hier kan je meer lezen over de mogelijke opmaakcodes.
Alvast bedankt!
Gewijzigd op 08/07/2015 16:06:34 door - Ariën -
Verder vind ik het vreemd dat je allemaal true of false waarden in de database wilt zetten.
$naam = isset($_GET["name"]); => geeft true of false in $naam.
Kom je daar wel terecht?
En daar moet je print_r($_POST); eens doen.
Wat krijg je dan te zien?
Daarnaast: het zou best kunnen dat je HTML verkeerd is.... wat een bende!
Over je HTML, gebruik graag CSS-stylesheet's in plaats van de stylen inline per element te beschrijven.