Ik zit al een tijdje te blokken maar kom er echt niet uit en wil vragen of iemand mij verder kan helpen. Ik heb hier een e-commerce script en wil vanaf mijn bestelling een formulier versturen per e-mail. Ik krijg alles in mijn e-mail behalve de bestelling zelf.
Het script ziet er als volgt uit:
Mijn formulier ziet er als volgt uit
Kan iemand mijn hiermee verder helpen want wil graag deze shop in productie zien maar ben er al 3 dagen mee bezig en zie door de bomen het bos niet meer en weet niet welke variable ik moet pakken.
Het script ziet er als volgt uit:
code:
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
| <!-- #INCLUDE FILE="settings.asp" -->
<html>
<head>
<TITLE></TITLE>
<link rel="stylesheet" HREF="master_style.css">
</head>
<BODY TEXT="#000000" BACKGROUND="images/bg_middle.gif" LINK="#000000" VLINK="#000000" ALINK="#F70404">
<script language="JavaScript" type="text/javascript">
<!--
function form_validator(theForm) {
if(theForm.searchstring.value == "") {
alert("<%=txt_empty_search%>!");
theForm.searchstring.focus();
return(false);
}
return (true);
}
//-->
</script>
<script LANGUAGE="JavaScript">
// showItems() - displays shopping basket in a table
function showItems() {
index = document.cookie.indexOf("ShoppingBasket");
countbegin = (document.cookie.indexOf("=", index) + 1);
countend = document.cookie.indexOf(";", index);
if (countend == -1) {
countend = document.cookie.length;
}
fulllist = document.cookie.substring(countbegin, countend);
subtotal = 0;
itemlist = 0;
for (var i = 0; i <= fulllist.length; i++) {
if (fulllist.substring(i,i+1) == '[') {
itemstart = i+1;
thisitem = 1;
} else if (fulllist.substring(i,i+1) == ']') {
itemend = i;
thequantity = fulllist.substring(itemstart, itemend);
itemtotal = 0;
itemtotal = (eval(theprice*thequantity));
temptotal = itemtotal * 100;
subtotal = subtotal + itemtotal;
itemlist=itemlist+1;
} else if (fulllist.substring(i,i+1) == '|') {
if (thisitem==1) theitem = fulllist.substring(itemstart, i);
if (thisitem==2) theprice = fulllist.substring(itemstart, i);
if (thisitem==3) theoption = fulllist.substring(itemstart, i);
thisitem++;
itemstart=i+1;
}
}
document.writeln('<FONT SIZE="2" FACE="Verdana, Arial, Helvetica, sans-serif"><%=txt_total %> <%=txt_currency%>: <B>'+top.center.cart.alterError(subtotal)+'</B></FONT>');
}
function updateItem(itemno, newquant) {
newItemList = null;
itemlist = 0;
for (var i = 0; i <= fulllist.length; i++) {
if (fulllist.substring(i,i+1) == '[') {
thisitem = 1;
itemstart = i+1;
fullstart = i+1;
} else if (fulllist.substring(i,i+1) == ']') {
itemend = i;
itemlist=itemlist+1;
if (itemlist != itemno) {
newItemList = newItemList+'['+fulllist.substring(fullstart, itemend)+']';
} else {
newItemList = newItemList + '['+theitem+'|'+theprice+'|'+theoption+'|'+newquant+']';
}
} else if (fulllist.substring(i,i+1) == '|') {
if (thisitem==1) theitem = fulllist.substring(itemstart, i);
if (thisitem==2) theprice = fulllist.substring(itemstart, i);
if (thisitem==3) theoption = fulllist.substring(itemstart, i);
thisitem++;
itemstart=i+1;
}
}
index = document.cookie.indexOf("ShoppingBasket");
document.cookie="ShoppingBasket="+newItemList;
self.location = "basket.asp";
}
function removeItem(itemno) {
newItemList = null;
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;
theitem = fulllist.substring(itemstart, itemend);
itemlist=itemlist+1;
if (itemlist != itemno) {
newItemList = newItemList+'['+fulllist.substring(itemstart, itemend)+']';
}
}
}
}
</script>
<form onSubmit="return form_validator(this)" method=post target=main action=search_list.asp>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<TR><TD VALIGN="middle" align="left" width="70">
[img]"images/space.gif"[/img]<BR>
<font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<b><%=txt_search%></b></font>
</TD><TD>
[img]"images/space.gif"[/img]<BR>
<SELECT name="chose">
<OPTION selected value="item"><%=txt_select_field%></OPTION>
<OPTION value="code_no"><%=txt_code_no%></OPTION>
<OPTION value="item"><%=txt_item%></OPTION>
<OPTION value="text"><%=txt_text%></OPTION>
</select>
<INPUT TYPE=text NAME="searchstring" VALUE="" SIZE=7>
<INPUT TYPE="submit" VALUE=" <%=txt_go%> " class="button">
<script LANGUAGE="JavaScript">
showItems();
</script>
</TD>
<td align="right" VALIGN="middle">
[img]"images/space.gif"[/img]<BR>
<font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>
| <a href="basket.asp" target="main"><%=txt_view_cart%></a> | <a href="order.asp" target="main"><%=txt_checkout %></a> |</b></font>
</td>
</tr></table>
</FORM>
</body>
</html> |
Mijn formulier ziet er als volgt uit
code:
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
| <!-- #INCLUDE FILE="settings.asp" -->
<%
' email values to set in form
'--------------------------------
' SendersName
' SendersEmail
' EmailSubject
' EmailRecipient
' message
' thanksPage
' set up email values
sendersName=request("name")
sendersEmail=request("email")
if sendersName="" then sendersName=sendersEmail
EmailSubject=request("EmailSubject")
if emailSubject="" then emailSubject="Online bestelling"
'I hardcode the email recipient but you might want this flexibility
EmailRecipient=("a@b.nl") ' required
if emailRecipient="" then
response.Write("<html><body>Sorry, recipient required!</body></html>")
response.End
end if
naam=Request.form("name")
adres=Request.form("address")
plaats=Request.form("city")
provincie=Request.form("state")
postcode=Request.form("zip")
land=Request.form("country")
telefoon=Request.form("phone")
opmerking=Request.form("comment")
total=Request.form("total")
orderid=Request.form("order_id")
order=Session("ShoppingBasket")
' create email
Set objNewMail = Server.CreateObject("CDONTS.NewMail")
objNewMail.From = sendersName & "<" & sendersEmail & ">"
objNewMail.Subject = request("EmailSubject")
objNewMail.To = EmailRecipient
objNewMail.Body = "Naam: " & naam & vbcrlf & "Adres: " & adres & vbcrlf & "Postcode" & postcode & vbcrlf & "Plaats: " & Plaats & vbcrlf & "Provincie: " & provincie & vbcrlf & "Land: " & land & vbcrlf & "Telefoonnummer: " & telefoon & vbcrlf & "Opmerkingen: " & opmerking & vbcrlf & vbcrlf & "Orderid: " & orderid & vbcrlf & vbcrlf & "Order: " & vbcrlf & order & vbcrlf & "Totaal: " & total & vbcrlf & vbcrlf & "Host:" & request.ServerVariables("REMOTE_ADDR") & vbcrlf & "Referer:" & request.ServerVariables("HTTP_REFERER")
' send email
objNewMail.Send
set objMail = nothing
response.redirect "response.asp"
%> |
Kan iemand mijn hiermee verder helpen want wil graag deze shop in productie zien maar ben er al 3 dagen mee bezig en zie door de bomen het bos niet meer en weet niet welke variable ik moet pakken.