IIk heb een form met onderstaande code:
HTML:
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
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <table width="100%" border="0" cellpadding="0" cellspacing="0" dwcopytype="CopyTableRow"> <tr> <td width="100%" valign="top"></td> </tr> <tr> <td width="100%" valign="top"> <script LANGUAGE="JavaScript"> // alterError - fixes a rounding bug in Netscape 2 function alterError(value) { if (value<=0.99) { newPounds = '0'; } else { newPounds = parseInt(value); } newPence = parseInt((value+.0008 - newPounds)* 100); if (eval(newPence) <= 9) newPence='0'+newPence; newString = newPounds + '.' + newPence; return (newString); } // showItems () - creates a table of items in the basket and // creates the start of a form which sets information for // basket items. function showItems() { index = document.cookie.indexOf("TheBasket"); countbegin = (document.cookie.indexOf("=", index) + 1); countend = document.cookie.indexOf(";", index); if (countend == -1) { countend = document.cookie.length; } fulllist = document.cookie.substring(countbegin, countend); totprice = 0; document.writeln('<FORM action="">'); document.writeln('<TABLE BORDER COLS=4>'); document.writeln('<TR><TD><b>Item</b></TD><TD><b>Quantity</b></TD><TD><b>Cost Each</b></TD><td><b>Total Cost</b></TR>'); itemlist = 0; for (var i = 0; i <= fulllist.length; i++) { if (fulllist.substring(i,i+1) == '[') { itemstart = i+1; } else if (fulllist.substring(i,i+1) == ']') { itemend = i; thequantity = fulllist.substring(itemstart, itemend); itemtotal = 0; itemtotal = (eval(theprice*thequantity)); temptotal = itemtotal * 100; totprice = totprice + itemtotal; itemlist=itemlist+1; document.writeln('<tr><td>'+theitem+'</td><td align=right>'+thequantity+'</td><td align=right>'+theprice+'</td><td align=right>'+alterError(itemtotal)+'</td></tr>'); document.writeln('<INPUT TYPE="hidden" NAME="item'+itemlist+'" VALUE="'+theitem+'" SIZE="40">'); document.writeln('<INPUT TYPE="hidden" NAME="quantity'+itemlist+'" VALUE="'+thequantity+'" SIZE="40">'); document.writeln('<INPUT TYPE="hidden" NAME="price each'+itemlist+'" VALUE="'+theprice+'" SIZE="40">'); document.writeln('<INPUT TYPE="hidden" NAME="total cost'+itemlist+'" VALUE="'+alterError(itemtotal)+'" SIZE="40">'); } else if (fulllist.substring(i,i+1) == ',') { theitem = fulllist.substring(itemstart, i); itemstart = i+1; } else if (fulllist.substring(i,i+1) == '#') { theprice = fulllist.substring(itemstart, i); itemstart = i+1; } } document.writeln('<tr><td colspan=3><b>Total</b></td><td align=right>'+alterError(totprice)+'</td></tr>'); document.writeln('<INPUT TYPE="hidden" NAME="goodstotal" VALUE="'+alterError(totprice)+'" SIZE="40">'); document.writeln('</TABLE>'); } </script> <!--webbot bot="HTMLMarkup" startspan TAG="XBOT" --></SCRIPT><!--webbot bot="HTMLMarkup" endspan --> <p></p> <form action="confirmation.asp" <p></p> <p> <script LANGUAGE="JavaScript"> showItems(); </script> </p> <p align="center"><br> <table cols=2 width="100%"> <tr> <td bgcolor="#FFFFD5"><font face="Arial" size="2">Name</font></td> <td bgcolor="#FFFFD5"><font face="Arial" size="2"><input type=text name="naam" size=40></font></td> </tr> <tr> <td bgcolor="#FFFFD5"><font face="Arial" size="2">Street</font></td> <td bgcolor="#FFFFD5"><font face="Arial" size="2"><input type=text name="adres" size=40></font></td> </tr> <tr> <td bgcolor="#EEF7DD"><font face="Arial" size="2">Town/City</font></td> <td bgcolor="#EEF7DD"><font face="Arial" size="2"><input type=text name="woonplaats" size=30></font></td> </tr> <tr> <td bgcolor="#EEF7DD"><font face="Arial" size="2">Postcode</font></td> <td bgcolor="#EEF7DD"><font face="Arial" size="2"><input type=text name="postcode" size=20></font></td> </tr> <tr> <td bgcolor="#EEF7DD"><font face="Arial" size="2">Telephone</font></td> <td bgcolor="#EEF7DD"><font face="Arial" size="2"><input type=text name="telefoon" size=30></font></td> </tr> <tr> <td bgcolor="#EEF7DD"><font face="Arial" size="2">Email address</font></td> <td bgcolor="#EEF7DD"><font face="Arial" size="2"><input type=text name="email" size=40></font></td> </tr> </table> <p> <input type="submit" name="order_finished" value="Send Order"> </p> </form> <p align="center"> <font size="2" face="Arial"> <br> </font> </p> </td> </tr> </table> </body> </html> |
nu wil ik ipv gewoon te versturen het bericht opmaken met ASP net zoiets als CGI dit bestand heet confirmation.asp:
ASP:
1
2
3
4
5
6
7
8
9
10
11
12
| <% Dim t1 t1 = Request.Form("naam") Set JMail = Server.CreateObject("JMail.SMTPMail") JMail.ServerAddress = "mail.is.nl:25" JMail.AddRecipient "blaat@home.nl" JMail.Sender = "blaat@home.nl" JMail.Subject = "Bestelling" JMail.Body = vbCrLf & "Naam: " & Request.Form("naam") JMail.Execute Response.Write"Blaat" %> |
maar nu stuurt ie netjes een email en laat wel naam: zien maar niet de inhoud van het veld... Hoe kan dat?
[ Voor 53% gewijzigd door Glimi op 01-12-2002 22:04 ]
Never eat yellow snow...