Fout bij winkelkar
Ik zit met een probleem.. Ik ben bezig om een webwinkel op te zetten, echter krijgen sommigen mensen een error wanneer ze de winkelkar te zien krijgen.
cart.php
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
<?php
ob_start();
session_start();
?>
<?
include_once("header.inc");
$_SESSION['winkelwagen']['activate'] = 0;
function valid_mail($email){
$email_host = explode("@", $email);
$email_host = $email_host[1];
$email_resolved = gethostbyname($email_host);
if ($email_resolved == $email_host) {
return false;
}
else{
return true;
}
}
function showcart()
{
//Code om de winkelwagen te laten zien
$totaal = "";
foreach($_SESSION['winkelwagen'] as $prodID => $at){
if (file_exists("WSFILES/" . $prodID . "_n")){
$totaal = $totaal + $at;
}
}
echo "<h1>Winkelwagen</h1>";
echo '<a href="index.php"><img src="pr.bmp" border="0" alt="Terug naar de index..."></a>';
if ($totaal == "1"){
$hv = "artikel";
}
else{
$hv = "artikelen";
}
echo "<p>U heeft op dit moment " . $totaal . " " . $hv . " in uw winkelwagen.";
echo "<br><br>";
if (!$totaal == "0"){
//Laat de tabel met artikelen zien...
?>
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="../style.css" rel="stylesheet" type="text/css" />
<br />
<tr bgcolor="#6487DC">
<td valign="top"><p><b>Procuct</b></p>
<td valign="top" colspan="2"><p><b>Prijs per stuk</b></p>
<td valign="top"><p><b>Aantal</b></p>
<td valign="top" colspan="2"><p><b>Bedrag</b></p>
</tr>
<?
$prijs = "";
foreach($_SESSION['winkelwagen'] as $prodID => $aantal){
if((!$aantal == "" || !$aantal == "0") && file_exists("WSFILES/" . $prodID . "_n")){
$file = fopen("WSFILES/" . $prodID . "_n", "r");
$q = "";
while (!feof($file)){
$q .= fgets($file, 1024);
}
fclose($file);
echo "<form name=bestelform action=cart.php method=GET>";
echo "<input type=hidden name=q value=add>";
echo "<input type=hidden name=PHPSESSID value=" . session_id() . ">";
echo "<input type=hidden name=prodID value=" . $prodID . ">";
echo "<tr><td valign=top><p>" . $q . "</p>";
$file = fopen("WSFILES/" . $prodID . "_p", "r");
$q = "";
while (!feof($file)){
$q .= fgets($file, 1024);
}
fclose($file);
$prijs = $prijs + ($aantal * $q);
echo "<td valign=top><p>€<td valign=top>";
echo "<div align=right><p>" . number_format($q, 2, ",", ".") . " </p></div>";
echo "<td valign=top><input type=text size=3 maxlength=2 name=aantal value=" . $aantal . ">";
echo " <input type=submit value=Bijwerken>";
echo " ";
echo "<a href=cart.php?PHPSESSID=" . session_id() . "&q=del&prodID=" . $prodID . ">";
echo "<img src=verwijderen.bmp border=0 alt=Verwijderen></a>";
echo "<td valign=top><p>€<td valign=top>";
echo "<div align=right><p>" . number_format(($aantal * $q), 2, ",", ".");
echo "</p></div></p></td></tr></form>";
}
}
echo "<tr><td colspan=4 valign=top><p>Verzendkosten binnen Nederland</p>";
echo "<td valign=top><p>€</p><td valign=top><div align=right>";
$file = fopen("config.php", "r");
$string = fgets($file, 1024);
list($q, $webshopnaam, $mail, $verzend, $gebruiker, $wachtwoord, $q) = split(",", $string);
fclose($file);
echo "<p>" . number_format($verzend, 2, ",", ".") . "</p></div></td></tr>";
$prijs = $prijs + $verzend;
echo "<tr><td valign=top><p><b>Totaal</b></p>";
echo "<td valign=top>";
echo "<td valign=top>";
echo "<td valign=top>";
echo "<td valign=top><p><b>€</b></p><td valign=top><div align=right>";
echo "<p><b>" . number_format($prijs, 2, ",", ".") . "</b></p></div></td></tr>";
echo "</table>";
?><br>
<table border="0"><tr><td>
<a href="cart.php?PHPSESSID=<? echo session_id(); ?>&q=bfr">
<img src="bes.bmp" border="0" alt="Bestelling afhandelen"></a><td>
<a href="cart.php?PHPSESSID=<? echo session_id(); ?>&q=bfr">Bestelling afhandelen</a>
<td>
<a href="cart.php?PHPSESSID=<? echo session_id(); ?>&q=emp">
<img src="emp.bmp" border="0" alt="Winkelwagen leegmaken"></a><td>
<a href="cart.php?PHPSESSID=<? echo session_id(); ?>&q=emp">Winkelwagen leegmaken</a>
<td>
<a href="javascript:window.print()">
<img src="printer.bmp" border="0" alt="Pagina afdrukken"></a><td>
<a href="javascript:window.print()">Pagina afdrukken</a>
</td></tr></table>
<?
}}
if($_GET['q'] == "add"){
//Product toevoegen óf wijzigen...
if(!file_exists("WSFILES/" . $_GET['prodID'] . "_n")){
echo "<h1>Winkelwagen</h1>";
echo "<p class=w>Er is een fout opgetreden, er bestaat geen product met artikelnummer ";
echo $_GET['prodID'];
echo ".</p>";
}
else{
$_SESSION['winkelwagen'][$_GET['prodID']] = $_GET['aantal'];
showcart();
}
}
if($_GET['q'] == "del"){
$_SESSION['winkelwagen'][$_GET['prodID']] = 0;
showcart();
}
if($_GET['q'] == "emp"){
//Winkelwagen leegmaken...
foreach($_SESSION['winkelwagen'] as $prod => $aantal){
$_SESSION['winkelwagen'][$prod] = "";
}
showcart();
}
if($_GET['q'] == "shw"){
showcart();
}
if($_GET['q'] == "bfr"){
echo "<h1>Bestelling afhandelen</h1>";
echo '<a href="cart.php?PHPSESSID=' . session_id() . '&q=shw">';
echo '<img src="pr.bmp" border="0" alt="Terug naar de winkelwagen..."></a><br>';
?>
<form name="bestelform" action="cart.php" method="GET">
<input type="hidden" name="PHPSESSID" value="<? echo session_id(); ?>">
<input type="hidden" name="q" value="cfr">
Uw naam: <br>
<input type="text" name="naam">
<br>
Uw e-mailadres: <br>
<input type="text" name="mail">
<br>
Uw adres: <br>
<input type="text" name="adres">
<br>
Uw postcode: <br>
<input type="text" name="post">
<br>
Uw woonplaats: <br>
<input type="text" name="wnpl">
<br><input type="submit" value="Bestelling controleren">
</form>
<script>
document.bestelform.naam.focus();
</script>
<?
}
if($_GET['q'] == "cfr"){
echo "<h1>Bestelling controleren</h1>";
echo '<a href="cart.php?PHPSESSID=' . session_id() . '&q=shw">';
echo '<img src="pr.bmp" border="0" alt="Terug naar de winkelwagen..."></a>';
if (!$_GET['naam'] || !valid_mail($_GET['mail']) || !$_GET['adres'] || !$_GET['post'] || !$_GET['wnpl']){
//Formulier fout ingevuld!
echo "<p class=w>Het formuler is niet correct ingevuld!</p>";
}else{
//Formulier goed ingevuld!
echo "<p>Controleer de onderstaande gegevens, zijn deze correct? Klik dan op 'Bestellen'.</p>";
echo "<p>";
echo "<b>Uw naam: </b>" . $_GET['naam'] . "<br>";
echo "<b>Uw e-mailadres: </b>" . $_GET['mail'] . "<br>";
echo "<b>Uw adres: </b>" . $_GET['adres'] . "<br>";
echo "<b>Uw postcode: </b>" . $_GET['post'] . "<br>";
echo "<b>Uw woonplaats: </b>" . $_GET['wnpl'] . "<br><br>";
echo "<b>Uw bestelling:</b><br>";
$totaal = "";
foreach($_SESSION['winkelwagen'] as $prodID => $aantal){
if (!$aantal == "0"){
$file = fopen("WSFILES/" . $prodID . "_n", "r");
$q = "";
while (!feof($file)){
$q .= fgets($file, 1024);
}
fclose($file);
$file = fopen("WSFILES/" . $prodID . "_p", "r");
$p = "";
while (!feof($file)){
$p .= fgets($file, 1024);
}
fclose($file);
$p = $aantal * $p;
$totaal = $totaal + $p;
echo $aantal . " x " . $q . " = € " . number_format($p, 2, ",", ".") . "<br>";
}}
echo "Verzendkosten = ";
echo "€ ";
$file = fopen("config.php", "r");
$string = fgets($file, 1024);
list($q, $webshopnaam, $mail, $verzend, $gebruiker, $wachtwoord, $q) = split(",", $string);
fclose($file);
echo number_format($verzend, 2, ",", ".") . "<br>";
$totaal = $totaal + $verzend;
echo "<b>Totaal: € " . number_format($totaal, 2, ",", ".") . "</b>";
echo "<form name=f action=cart.php?q=abe&PHPSESSID=" . session_id() . " method=GET>";
echo '<input type="hidden" name="PHPSESSID" value="' . session_id() . '">';
echo '<input type="hidden" name="q" value="abe">';
echo '<input type="hidden" name="naam" value="' . $_GET['naam'] . '">';
echo '<input type="hidden" name="mail" value="' . $_GET['mail'] . '">';
echo '<input type="hidden" name="adres" value="' . $_GET['adres'] . '">';
echo '<input type="hidden" name="post" value="' . $_GET['post'] . '">';
echo '<input type="hidden" name="wnpl" value="' . $_GET['wnpl'] . '">';
echo "<input type=submit value=Bestellen>";
echo "</form>";
}
}
if($_GET['q'] == "abe"){
$bericht = "";
$bericht .= "Naam:\n" . $_GET['naam'] . "\n";
$bericht .= "E-mailadres:\n" . $_GET['mail'] . "\n";
$bericht .= "Adres:\n" . $_GET['adres'] . "\n";
$bericht .= "Postcode:\n" . $_GET['post'] . "\n";
$bericht .= "Woonplaats:\n" . $_GET['wnpl'] . "\n\n";
$bericht .= "Bestelling:\n\n";
foreach($_SESSION['winkelwagen'] as $prodID => $aantal){
if (!$aantal == "0"){
$file = fopen("WSFILES/" . $prodID . "_n", "r");
$q = "";
while (!feof($file)){
$q .= fgets($file, 1024);
}
fclose($file);
$file = fopen("WSFILES/" . $prodID . "_p", "r");
$p = "";
while (!feof($file)){
$p .= fgets($file, 1024);
}
fclose($file);
$p = $aantal * $p;
$totaal = $totaal + $p;
$bericht .= $aantal . " x " . $q . " = € " . number_format($p, 2, ",", ".") . "\n";
}}
$bericht .= "Verzendkosten = ";
$bericht .= "€ ";
$file = fopen("config.php", "r");
$string = fgets($file, 1024);
list($q, $webshopnaam, $mail, $verzend, $gebruiker, $wachtwoord, $q) = split(",", $string);
fclose($file);
$bericht .= number_format($verzend, 2, ",", ".");
$totaal = $totaal + $verzend;
$bericht .= "\n\nTotaal: € " . number_format($totaal, 2, ",", ".");
if (!mail($_GET['mail'], "Uw bestelling", "De volgende bestelling is ingevoerd bij " . $webshopnaam . "\n\n" . $bericht) || !mail($mail, "Bestelling van " . $webshopnaam, "De volgende bestelling is ingevoerd bij " . $webshopnaam . "\n\n" . $bericht)){
//Bestelling niet verstuurd...
echo "<h1>Bestelling afhandelen</h1>";
echo '<a href="cart.php?PHPSESSID=' . session_id() . '&q=shw">';
echo '<img src="pr.bmp" border="0" alt="Terug naar de winkelwagen..."></a>';
echo "<p class=w>De bestelling kon niet worden verzonden!</p>";
}
else{
foreach($_SESSION['winkelwagen'] as $x => $q){
$_SESSION['winkelwagen'][$x] = "0";
}
echo "<h1>Bestelling afhandelen</h1>";
echo '<a href="cart.php?PHPSESSID=' . session_id() . '&q=shw">';
echo '<img src="pr.bmp" border="0" alt="Terug naar de winkelwagen..."></a>';
echo "<p>Uw bestelling is met succes verstuurd!";
echo "<br><br>Uw winkelwagen is automatisch leeg gemaakt!</p>";
}
}
?>
ob_start();
session_start();
?>
<?
include_once("header.inc");
$_SESSION['winkelwagen']['activate'] = 0;
function valid_mail($email){
$email_host = explode("@", $email);
$email_host = $email_host[1];
$email_resolved = gethostbyname($email_host);
if ($email_resolved == $email_host) {
return false;
}
else{
return true;
}
}
function showcart()
{
//Code om de winkelwagen te laten zien
$totaal = "";
foreach($_SESSION['winkelwagen'] as $prodID => $at){
if (file_exists("WSFILES/" . $prodID . "_n")){
$totaal = $totaal + $at;
}
}
echo "<h1>Winkelwagen</h1>";
echo '<a href="index.php"><img src="pr.bmp" border="0" alt="Terug naar de index..."></a>';
if ($totaal == "1"){
$hv = "artikel";
}
else{
$hv = "artikelen";
}
echo "<p>U heeft op dit moment " . $totaal . " " . $hv . " in uw winkelwagen.";
echo "<br><br>";
if (!$totaal == "0"){
//Laat de tabel met artikelen zien...
?>
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="../style.css" rel="stylesheet" type="text/css" />
<br />
<tr bgcolor="#6487DC">
<td valign="top"><p><b>Procuct</b></p>
<td valign="top" colspan="2"><p><b>Prijs per stuk</b></p>
<td valign="top"><p><b>Aantal</b></p>
<td valign="top" colspan="2"><p><b>Bedrag</b></p>
</tr>
<?
$prijs = "";
foreach($_SESSION['winkelwagen'] as $prodID => $aantal){
if((!$aantal == "" || !$aantal == "0") && file_exists("WSFILES/" . $prodID . "_n")){
$file = fopen("WSFILES/" . $prodID . "_n", "r");
$q = "";
while (!feof($file)){
$q .= fgets($file, 1024);
}
fclose($file);
echo "<form name=bestelform action=cart.php method=GET>";
echo "<input type=hidden name=q value=add>";
echo "<input type=hidden name=PHPSESSID value=" . session_id() . ">";
echo "<input type=hidden name=prodID value=" . $prodID . ">";
echo "<tr><td valign=top><p>" . $q . "</p>";
$file = fopen("WSFILES/" . $prodID . "_p", "r");
$q = "";
while (!feof($file)){
$q .= fgets($file, 1024);
}
fclose($file);
$prijs = $prijs + ($aantal * $q);
echo "<td valign=top><p>€<td valign=top>";
echo "<div align=right><p>" . number_format($q, 2, ",", ".") . " </p></div>";
echo "<td valign=top><input type=text size=3 maxlength=2 name=aantal value=" . $aantal . ">";
echo " <input type=submit value=Bijwerken>";
echo " ";
echo "<a href=cart.php?PHPSESSID=" . session_id() . "&q=del&prodID=" . $prodID . ">";
echo "<img src=verwijderen.bmp border=0 alt=Verwijderen></a>";
echo "<td valign=top><p>€<td valign=top>";
echo "<div align=right><p>" . number_format(($aantal * $q), 2, ",", ".");
echo "</p></div></p></td></tr></form>";
}
}
echo "<tr><td colspan=4 valign=top><p>Verzendkosten binnen Nederland</p>";
echo "<td valign=top><p>€</p><td valign=top><div align=right>";
$file = fopen("config.php", "r");
$string = fgets($file, 1024);
list($q, $webshopnaam, $mail, $verzend, $gebruiker, $wachtwoord, $q) = split(",", $string);
fclose($file);
echo "<p>" . number_format($verzend, 2, ",", ".") . "</p></div></td></tr>";
$prijs = $prijs + $verzend;
echo "<tr><td valign=top><p><b>Totaal</b></p>";
echo "<td valign=top>";
echo "<td valign=top>";
echo "<td valign=top>";
echo "<td valign=top><p><b>€</b></p><td valign=top><div align=right>";
echo "<p><b>" . number_format($prijs, 2, ",", ".") . "</b></p></div></td></tr>";
echo "</table>";
?><br>
<table border="0"><tr><td>
<a href="cart.php?PHPSESSID=<? echo session_id(); ?>&q=bfr">
<img src="bes.bmp" border="0" alt="Bestelling afhandelen"></a><td>
<a href="cart.php?PHPSESSID=<? echo session_id(); ?>&q=bfr">Bestelling afhandelen</a>
<td>
<a href="cart.php?PHPSESSID=<? echo session_id(); ?>&q=emp">
<img src="emp.bmp" border="0" alt="Winkelwagen leegmaken"></a><td>
<a href="cart.php?PHPSESSID=<? echo session_id(); ?>&q=emp">Winkelwagen leegmaken</a>
<td>
<a href="javascript:window.print()">
<img src="printer.bmp" border="0" alt="Pagina afdrukken"></a><td>
<a href="javascript:window.print()">Pagina afdrukken</a>
</td></tr></table>
<?
}}
if($_GET['q'] == "add"){
//Product toevoegen óf wijzigen...
if(!file_exists("WSFILES/" . $_GET['prodID'] . "_n")){
echo "<h1>Winkelwagen</h1>";
echo "<p class=w>Er is een fout opgetreden, er bestaat geen product met artikelnummer ";
echo $_GET['prodID'];
echo ".</p>";
}
else{
$_SESSION['winkelwagen'][$_GET['prodID']] = $_GET['aantal'];
showcart();
}
}
if($_GET['q'] == "del"){
$_SESSION['winkelwagen'][$_GET['prodID']] = 0;
showcart();
}
if($_GET['q'] == "emp"){
//Winkelwagen leegmaken...
foreach($_SESSION['winkelwagen'] as $prod => $aantal){
$_SESSION['winkelwagen'][$prod] = "";
}
showcart();
}
if($_GET['q'] == "shw"){
showcart();
}
if($_GET['q'] == "bfr"){
echo "<h1>Bestelling afhandelen</h1>";
echo '<a href="cart.php?PHPSESSID=' . session_id() . '&q=shw">';
echo '<img src="pr.bmp" border="0" alt="Terug naar de winkelwagen..."></a><br>';
?>
<form name="bestelform" action="cart.php" method="GET">
<input type="hidden" name="PHPSESSID" value="<? echo session_id(); ?>">
<input type="hidden" name="q" value="cfr">
Uw naam: <br>
<input type="text" name="naam">
<br>
Uw e-mailadres: <br>
<input type="text" name="mail">
<br>
Uw adres: <br>
<input type="text" name="adres">
<br>
Uw postcode: <br>
<input type="text" name="post">
<br>
Uw woonplaats: <br>
<input type="text" name="wnpl">
<br><input type="submit" value="Bestelling controleren">
</form>
<script>
document.bestelform.naam.focus();
</script>
<?
}
if($_GET['q'] == "cfr"){
echo "<h1>Bestelling controleren</h1>";
echo '<a href="cart.php?PHPSESSID=' . session_id() . '&q=shw">';
echo '<img src="pr.bmp" border="0" alt="Terug naar de winkelwagen..."></a>';
if (!$_GET['naam'] || !valid_mail($_GET['mail']) || !$_GET['adres'] || !$_GET['post'] || !$_GET['wnpl']){
//Formulier fout ingevuld!
echo "<p class=w>Het formuler is niet correct ingevuld!</p>";
}else{
//Formulier goed ingevuld!
echo "<p>Controleer de onderstaande gegevens, zijn deze correct? Klik dan op 'Bestellen'.</p>";
echo "<p>";
echo "<b>Uw naam: </b>" . $_GET['naam'] . "<br>";
echo "<b>Uw e-mailadres: </b>" . $_GET['mail'] . "<br>";
echo "<b>Uw adres: </b>" . $_GET['adres'] . "<br>";
echo "<b>Uw postcode: </b>" . $_GET['post'] . "<br>";
echo "<b>Uw woonplaats: </b>" . $_GET['wnpl'] . "<br><br>";
echo "<b>Uw bestelling:</b><br>";
$totaal = "";
foreach($_SESSION['winkelwagen'] as $prodID => $aantal){
if (!$aantal == "0"){
$file = fopen("WSFILES/" . $prodID . "_n", "r");
$q = "";
while (!feof($file)){
$q .= fgets($file, 1024);
}
fclose($file);
$file = fopen("WSFILES/" . $prodID . "_p", "r");
$p = "";
while (!feof($file)){
$p .= fgets($file, 1024);
}
fclose($file);
$p = $aantal * $p;
$totaal = $totaal + $p;
echo $aantal . " x " . $q . " = € " . number_format($p, 2, ",", ".") . "<br>";
}}
echo "Verzendkosten = ";
echo "€ ";
$file = fopen("config.php", "r");
$string = fgets($file, 1024);
list($q, $webshopnaam, $mail, $verzend, $gebruiker, $wachtwoord, $q) = split(",", $string);
fclose($file);
echo number_format($verzend, 2, ",", ".") . "<br>";
$totaal = $totaal + $verzend;
echo "<b>Totaal: € " . number_format($totaal, 2, ",", ".") . "</b>";
echo "<form name=f action=cart.php?q=abe&PHPSESSID=" . session_id() . " method=GET>";
echo '<input type="hidden" name="PHPSESSID" value="' . session_id() . '">';
echo '<input type="hidden" name="q" value="abe">';
echo '<input type="hidden" name="naam" value="' . $_GET['naam'] . '">';
echo '<input type="hidden" name="mail" value="' . $_GET['mail'] . '">';
echo '<input type="hidden" name="adres" value="' . $_GET['adres'] . '">';
echo '<input type="hidden" name="post" value="' . $_GET['post'] . '">';
echo '<input type="hidden" name="wnpl" value="' . $_GET['wnpl'] . '">';
echo "<input type=submit value=Bestellen>";
echo "</form>";
}
}
if($_GET['q'] == "abe"){
$bericht = "";
$bericht .= "Naam:\n" . $_GET['naam'] . "\n";
$bericht .= "E-mailadres:\n" . $_GET['mail'] . "\n";
$bericht .= "Adres:\n" . $_GET['adres'] . "\n";
$bericht .= "Postcode:\n" . $_GET['post'] . "\n";
$bericht .= "Woonplaats:\n" . $_GET['wnpl'] . "\n\n";
$bericht .= "Bestelling:\n\n";
foreach($_SESSION['winkelwagen'] as $prodID => $aantal){
if (!$aantal == "0"){
$file = fopen("WSFILES/" . $prodID . "_n", "r");
$q = "";
while (!feof($file)){
$q .= fgets($file, 1024);
}
fclose($file);
$file = fopen("WSFILES/" . $prodID . "_p", "r");
$p = "";
while (!feof($file)){
$p .= fgets($file, 1024);
}
fclose($file);
$p = $aantal * $p;
$totaal = $totaal + $p;
$bericht .= $aantal . " x " . $q . " = € " . number_format($p, 2, ",", ".") . "\n";
}}
$bericht .= "Verzendkosten = ";
$bericht .= "€ ";
$file = fopen("config.php", "r");
$string = fgets($file, 1024);
list($q, $webshopnaam, $mail, $verzend, $gebruiker, $wachtwoord, $q) = split(",", $string);
fclose($file);
$bericht .= number_format($verzend, 2, ",", ".");
$totaal = $totaal + $verzend;
$bericht .= "\n\nTotaal: € " . number_format($totaal, 2, ",", ".");
if (!mail($_GET['mail'], "Uw bestelling", "De volgende bestelling is ingevoerd bij " . $webshopnaam . "\n\n" . $bericht) || !mail($mail, "Bestelling van " . $webshopnaam, "De volgende bestelling is ingevoerd bij " . $webshopnaam . "\n\n" . $bericht)){
//Bestelling niet verstuurd...
echo "<h1>Bestelling afhandelen</h1>";
echo '<a href="cart.php?PHPSESSID=' . session_id() . '&q=shw">';
echo '<img src="pr.bmp" border="0" alt="Terug naar de winkelwagen..."></a>';
echo "<p class=w>De bestelling kon niet worden verzonden!</p>";
}
else{
foreach($_SESSION['winkelwagen'] as $x => $q){
$_SESSION['winkelwagen'][$x] = "0";
}
echo "<h1>Bestelling afhandelen</h1>";
echo '<a href="cart.php?PHPSESSID=' . session_id() . '&q=shw">';
echo '<img src="pr.bmp" border="0" alt="Terug naar de winkelwagen..."></a>';
echo "<p>Uw bestelling is met succes verstuurd!";
echo "<br><br>Uw winkelwagen is automatisch leeg gemaakt!</p>";
}
}
?>
Hier is de pagina te vinden
Ik hoop dat jullie de fout zien.
Het kan zijn dat ie de error alleen geeft als je iets in de kar zet. http://www.vrds.nl/supersluys/shop daar de index te vinden.
Kopiëer je error eens hiernaartoe, want ikzelf zie geen error.
Dit boekwerk ga ik niet lezen...
Subtieler gezegd, probeer eens eruit te halen waar je denkt dat de error zit...