Webshop Mailscript
<table width="100%">
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
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
<?php
if (isset($_POST['artikelnummer']) && isset($_POST['mail']) && isset($_POST['adres'])) {
if ($_POST['artikelnummer'] == "" || $_POST['mail'] == "") {
print_error();
print_form();
} else {
mail("[email protected]", $_POST['subject'],
foreach ($_SESSION['Order'] as $Item)
{
$Body .= sprintf('
Titel : %s
Aantal : %s
Extra :
%s
Prijs (per stuk) : %s
Artikelnummer : %s ',
$Item['Titel'],
$_POST['aantal'][$Item['id']],
$_POST['extra'][$Item['id']],
$Item['Prijs'],
$Item['artikelnummer']."\r\n\r\n--------------------------------------------------------\r\n\r\n".
$_POST['titel'] . " " .
$_POST['voornaam'] . " " .
$_POST['tussenvoegsels'] . " " .
$_POST['achternaam'] . "\n" .
$_POST['adres'] . "\n" .
$_POST['postcode'] . "\n" .
$_POST['woonplaats'] . "\nT " .
$_POST['telefoon'] . "\nE" .
$_POST['mail']);
print_sent();
}
} else {
print_form();
}
function print_form() {
?>
if (isset($_POST['artikelnummer']) && isset($_POST['mail']) && isset($_POST['adres'])) {
if ($_POST['artikelnummer'] == "" || $_POST['mail'] == "") {
print_error();
print_form();
} else {
mail("[email protected]", $_POST['subject'],
foreach ($_SESSION['Order'] as $Item)
{
$Body .= sprintf('
Titel : %s
Aantal : %s
Extra :
%s
Prijs (per stuk) : %s
Artikelnummer : %s ',
$Item['Titel'],
$_POST['aantal'][$Item['id']],
$_POST['extra'][$Item['id']],
$Item['Prijs'],
$Item['artikelnummer']."\r\n\r\n--------------------------------------------------------\r\n\r\n".
$_POST['titel'] . " " .
$_POST['voornaam'] . " " .
$_POST['tussenvoegsels'] . " " .
$_POST['achternaam'] . "\n" .
$_POST['adres'] . "\n" .
$_POST['postcode'] . "\n" .
$_POST['woonplaats'] . "\nT " .
$_POST['telefoon'] . "\nE" .
$_POST['mail']);
print_sent();
}
} else {
print_form();
}
function print_form() {
?>
<form method="post" action="index.php?actie=winkelwagen">
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
foreach ( $_SESSION['Order'] as $OrderItem ) {
echo '<tr><td align="left"><input type="hidden" name="Titel" size="30" value="'.$OrderItem['Titel'].'" /><b>'.$OrderItem['Titel'].'</b></td>';
echo '<td align="right"><input type="hidden" name="prijs" size="30" value="€'.$OrderItem['Prijs'].'" /><b>€ '.$OrderItem['Prijs'].'</b></td></tr>';
echo '<tr><td rowspan="2">'.'<img src="uploads/'.$OrderItem['id'].'.jpg" title="productfoto" />'.'</td></tr>';
echo '<tr><td align="left">'.$OrderItem['beschrijving'].'</td></tr>';
echo '<tr><td>Aantal:</td><td> <input type="text" name="aantal['.$OrderItem['id'].']" value="1" size="45" /></td></tr>';
echo '<tr><td>Extra:</td><td> <textarea name="extra['.$OrderItem['id'].']" rows="5" cols="34" /></textarea></td></tr>';
echo '<tr><td><input type="hidden" name="artikelnummer" size="30" value="'.$OrderItem['artikelnummer'].'" /></td></tr>';
echo '<tr><td colspan="2"><br /><center><hr color="#143C64" size="0.5" width="530"></center><br /></td></tr>';
}
echo '</table>
<br/>';
?>
foreach ( $_SESSION['Order'] as $OrderItem ) {
echo '<tr><td align="left"><input type="hidden" name="Titel" size="30" value="'.$OrderItem['Titel'].'" /><b>'.$OrderItem['Titel'].'</b></td>';
echo '<td align="right"><input type="hidden" name="prijs" size="30" value="€'.$OrderItem['Prijs'].'" /><b>€ '.$OrderItem['Prijs'].'</b></td></tr>';
echo '<tr><td rowspan="2">'.'<img src="uploads/'.$OrderItem['id'].'.jpg" title="productfoto" />'.'</td></tr>';
echo '<tr><td align="left">'.$OrderItem['beschrijving'].'</td></tr>';
echo '<tr><td>Aantal:</td><td> <input type="text" name="aantal['.$OrderItem['id'].']" value="1" size="45" /></td></tr>';
echo '<tr><td>Extra:</td><td> <textarea name="extra['.$OrderItem['id'].']" rows="5" cols="34" /></textarea></td></tr>';
echo '<tr><td><input type="hidden" name="artikelnummer" size="30" value="'.$OrderItem['artikelnummer'].'" /></td></tr>';
echo '<tr><td colspan="2"><br /><center><hr color="#143C64" size="0.5" width="530"></center><br /></td></tr>';
}
echo '</table>
<br/>';
?>
<tr><td><b><br />Persoongegevens:<br /><br /></td></tr>
<tr>
<td>Titel:</td>
<td> <select name="titel">
<option value="Dhr.">Dhr.</option>
<option value="Mevr.">Mevr.</option>
</select>
<br /></td>
</tr>
<tr>
<td><span class="invoerveld">Voornaam:</span><br /></td>
<td><input type="text" name="voornaam" size="14" />*<br /></td>
</tr>
<tr>
<td><span class="invoerveld">Tussenvoegsels:</span><br /></td>
<td><input type="text" name="tussenvoegsels" size="14" /><br /></td>
</tr>
<tr>
<td><span class="invoerveld">Achternaam:</span></td>
<td><input type="text" name="achternaam" size="14" />*<br /></td>
</tr>
<tr>
<td><span class="invoerveld">Adres:</span></td>
<td><input type="text" name="adres" size="14" />*<br /></td>
</tr>
<tr>
<td><span class="invoerveld">Postcode:</span></td>
<td><input type="text" name="postcode" size="14" />*<br /></td>
</tr>
<tr>
<td><span class="invoerveld">Woonplaats:</span></td>
<td><input type="text" name="woonplaats" size="14" />*<br /></td>
</tr>
<tr>
<td><span class="invoerveld">Telefoonnummer:</span></td>
<td><input type="text" name="telefoon" size="14" />*<br /></td>
</tr>
<tr>
<td><span class="invoerveld">Email adres:</span></td>
<td><input type="text" name="mail" size="14" />*<br /></td>
</tr>
<tr>
<td align="left"><input type="hidden" name="subject" value="Bestelling www.stip-sportswear.nl"></td></tr>
<tr><td> </td>
<td><input type="submit" name="submit" value="versturen" class="submitknop" /> <input type="reset" value="reset" /></td></tr>
<tr><td></td></tr>
</form>
<tr>
<td colspan="4"><br />* Deze gegevens moet u verplicht invullen<br /></td>
</tr>
<table width=100%>
<tr><td>Graag alle verplichte velden invullen.<br />
<br /></td></tr>
</table>
<table width=100%>
<tr><td>Uw bestelling is verstuurd!
</td></tr>
</table>
</table>
Errors wel.