For at gøre det nemmere at hjælpe mig er her hele den side der driller mig.
samt et uddrag af FAQ fra min host.
Siden:
<!-- #include file="order_configuration.asp" -->
<%
Response.Buffer = True
' -> DETTE ER VARIABLERNE TIL DATABASEN.
Dim myConn
Dim strSQL
' -> DSNLess FORBINDELSE TIL DATABASEN.
Set myConn = Server.CreateObject("ADODB.Connection")
myConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("e-shop.mdb")
strSQL = "SELECT KategoriID, KategoriNavn, KategoriParent, KategoriRank FROM Kategorier ORDER BY KategoriRank"
Set rs = myConn.Execute(strSQL)
Dim Kategorier(100,4)
While Not rs.EOF
If i < 100 Then
Kategorier(i,0) = rs("KategoriNavn")
Kategorier(i,1) = rs("KategoriParent")
Kategorier(i,2) = rs("KategoriID")
Kategorier(i,3) = rs("KategoriRank")
End If
i = i +1
rs.MoveNext
Wend
arrayLength = i -1
Function Show_search(Parent1, KategoriLayer)
If Parent1 <> vbNullString Then
For t = 0 To arrayLength
If Kategorier(t,1) = Parent1 Then
EmptySpace = ""
For x = 0 To KategoriLayer
EmptySpace = EmptySpace & " "
' -> 'EmptySpace & " "' LAVER EN INDRYKNING FOR HVER KATEGORI.
Next
If KategoriLayer = 0 Then
CSS_Start = ""
CSS_End = ""
End If
' -> 'CSS_Start' OG 'CSS_End' TILLADER SPECIEL CSS SPECIFIKATION FOR HVER HOVEDKATEGORI (PARENT).
Response.Write(EmptySpace & "<a href=" & chr(34) & "order_product.asp?r=" & Kategorier(t,2) & chr(34) & ">" & CSS_Start & Kategorier(t,0) & CSS_End & "</a><br clear=" & chr(34) & "all" & chr(34) & ">" & vbCrLf)
Parent2 = Kategorier(t,2)
KategoriLayer1 = KategoriLayer +1
Show_search Parent2, KategoriLayer1
End If
Next
End If
End Function
Function CheckField(input)
If Len(input) < 1 Then OK = 1
CheckField = input
End Function
%>
<%
Response.AddHeader "cache-control","private"
Response.AddHeader "pragma","no-cache"
Response.CacheControl = "no-cache"
Response.CacheControl = "private"
Response.Expires = -1
Response.ExpiresAbsolute = Now() -1
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<title>Mariehønen</title>
<meta name="Generator" content="Stone's WebWriter 4">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta http-equiv="expires" content="-1">
<meta http-equiv="pragma" content="no-cache">
<meta name="author" content="Michael Salling">
<meta name="description" content="Hjemmesyet børnetøj">
<link rel="stylesheet" type="text/css" href="e-shop.css">
</head>
<body onLoad="if ('Navigator' == navigator.appName) document.forms[0].reset();">
<!-- TITEL START -->
<table align="center" border="0" cellpadding="0" cellspacing="0" width="600">
<tr>
<td align="left" valign="top" width="600">
<h1>Mariehønen</h1>
</td>
</tr>
</table>
<!-- TITEL SLUT -->
<!-- TOM TABEL FOR AT GIVE MERE PLADS -->
<table align="center" border="0" cellpadding="0" cellspacing="0" width="600">
<tr>
<td align="left" valign="top" width="600">
<p> </p>
</td>
</tr>
</table>
<!-- INDHOLD START -->
<table align="center" border="0" cellpadding="0" cellspacing="0" width="600">
<tr>
<td align="left" valign="top" width="140">
<h3>Ordre Status</h3>
</td>
<td align="left" valign="top" width="460">
<%
OK = 0
If OrderForm_Company = True Then orderPerson = OrderPerson & OrderEmail_Company & ": " & CheckField(Request.Form("OrderForm_Company")) & vbCrLf
If OrderForm_Name = True Then orderPerson = OrderPerson & OrderEmail_Name & ": " & CheckField(Request.Form("OrderForm_Name")) & vbCrLf
If OrderForm_Street = True Then orderPerson = OrderPerson & OrderEmail_Street & ": " & CheckField(Request.Form("OrderForm_Street")) & vbCrLf
If OrderForm_PostalCode = True Then orderPerson = OrderPerson & OrderEmail_PostalCode & ": " & CheckField(Request.Form("OrderForm_PostalCode")) & vbCrLf
If OrderForm_City = True Then orderPerson = OrderPerson & OrderEmail_City & ": " & CheckField(Request.Form("OrderForm_City")) & vbCrLf
If OrderForm_Phone = True Then orderPerson = OrderPerson & OrderEmail_Phone & ": " & CheckField(Request.Form("OrderForm_Phone")) & vbCrLf
If OrderForm_Email = True Then orderPerson = OrderPerson & OrderEmail_Email & ": " & CheckField(Request.Form("OrderForm_Email")) & vbCrLf & vbCrLf
If OrderForm_Message = True Then orderPerson = OrderPerson & OrderEmail_Message & ": " & CheckField(Request.Form("OrderForm_Message")) & vbCrLf
If OK = 0 Then
OnlineOrder = Session("OnlineOrder")
If isArray(OnlineOrder) Then
i = Session("Items")
OrderMailText = OrderMailText & vbCrLf & vbCrLf
OrderMailText = OrderMailText & orderPerson & vbCrLf
OrderMailText = OrderMailText & "-------------------------------------------" & vbCrLf
For t = o To i
If (OnlineOrder(t,0)) <> "" Then
AllTogether_PerProduct = + OnlineOrder(t,0) * OnlineOrder(t,2)
AllTogether_AllProducts = formatNumber(AllTogether_AllProducts + AllTogether_PerProduct, 2,,-2)
OrderMailText = OrderMailText & ListProduct & ": " & OnlineOrder(t,4) & vbCrLf
OrderMailText = OrderMailText & ListNumber & ": " & OnlineOrder(t,3) & vbCrLf
OrderMailText = OrderMailText & ListQuantity & ": " & OnlineOrder(t,0) & vbCrLf
OrderMailText = OrderMailText & ListPrice & ": " & ListCurrency & formatNumber(OnlineOrder(t,2), 2,,-2) & vbCrLf
OrderMailText = OrderMailText & ListTotal & ": " & ListCurrency & formatNumber(AllTogether_PerProduct, 2,,-2) & vbCrLf
OrderMailText = OrderMailText & "-------------------------------------------" & vbCrLf
End If
Next
OrderMailText = OrderMailText & ListSubtotal & ": " & ListCurrency & formatNumber(AllTogether_AllProducts, 2,,-2) & vbCrLf
OrderMailText = OrderMailText & ListShipping & ": " & ListCurrency & ListShipping_Value & vbCrLf
OrderMailText = OrderMailText & "-------------------------------------------" & vbCrLf
OrderMailText = OrderMailText & ListSubTotalShipping & ": " & ListCurrency & formatNumber((AllTogether_AllProducts * ListZero_Value) + ListShipping_Value, 2,,-2) & vbCrLf
OrderMailText = OrderMailText & "-------------------------------------------" & vbCrLf
OrderMailText = OrderMailText & ListTax & ": " & ListCurrency & formatNumber((AllTogether_AllProducts * ListTax_Value) + (ListShipping_Value * ListTax_Value), 2,,-2) & vbCrLf
OrderMailText = OrderMailText & "-------------------------------------------" & vbCrLf
OrderMailText = OrderMailText & ListTotal_AllTogether & ": " & ListCurrency & formatNumber((AllTogether_AllProducts * ListTotal_AllTogether_Value) + (ListShipping_Value * ListTotal_AllTogether_Value), 2,,-2) & vbCrLf
OrderMailText = OrderMailText & "-------------------------------------------"
' ---------> HER BEGYNDER MAILKOMPONENTEN.
' -> DENNE MAILKOMPONENT ER 'ASPMail'.
' -> DETTE ER VARIABLERNE FRA FORMULARFELTERNE.
Dim strOrderForm_Name
Dim strOrderForm_Email
Dim strRecipient_Name
Dim strRecipient_Email
strOrderForm_Name = Request.Form("OrderForm_Name")
strOrderForm_Email = Request.Form("OrderForm_Email")
strRecipient_Name = "Mariehønen"
strRecipient_Email = "YYYY@ZZZZZZ.dk"
' -> DETTE ÅBNER ET MAILSERVEROBJEKT.
Set Mail = Server.CreateObject("Persits.MailSender")
' -> DETTE ER MAILSERVEREN, DER VIL SENDE E-MAIL'EN.
Mail.Host = "smtp.danhost.dk"
' -> DETTE ER AFSENDERENS NAVN FRA FORMULARFELTET.
Mail.FromName = strOrderForm_Name
' -> DETTE ER AFSENDERENS E-MAIL ADRESSE FRA FORMULARFELTET.
Mail.From = strOrderForm_Email
' -> DETTE ER AFSENDERENS SVAR E-MAIL ADRESSE FRA FORMULARFELTET.
Mail.AddReplyTo = "strOrderForm_Email"
' -> DETTE ER MODTAGERENS NAVN OG E-MAIL ADRESSE ("NAVN", "E-MAIL ADRESSE").
Mail.AddRecipient strRecipient_Name, strRecipient_Email
' -> DETTE ER MODTAGERENS NAVN OG E-MAIL ADRESSE ("NAVN", "E-MAIL ADRESSE").
' -> BEMÆRK: DETTE SENDER EN KOPI AF ORDREN TIL AFSENDEREN FRA FORMULAREN.
Mail.AddRecipient strOrderForm_Name, strOrderForm_Email
' -> DETTE ER EMNET PÅ E-MAIL'EN.
Mail.Subject = "Mariehønen - Ordre"
' -> DETTE ANGIVER PRIORITETEN: 1 = HØJ, 3 = NORMAL, 5 = LAV.
Mail.Priority = 3
' -> DETTE ANGIVER INDHOLDETS TYPE.
Mail.ContentType = "text/plain"
' -> DETTE ER INDHOLDET AF E-MAIL'EN. STANDARDTEKST ER KOMBINERET MED FORMULARVARIABLER.
Mail.BodyText = OrderMailText
Mail.SendMail
Set Mail = Nothing
' ---------> HER SLUTTER MAILKOMPONENTEN.
End If
End If
%>
<%If OK = 0 Then%>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="440">
<tr>
<td align="left" valign="top" width="440">
<%=OrderSubmitted%>
<!-- ORDRE HER - START -->
<table align="center" border="0" cellpadding="0" cellspacing="0" width="350">
<tr>
<td align="left" valign="top" width="100%">
<p><span class="order"><%
If Not isNull(OrderMailText) Then
' -> MELLEMRUM, LINIESKIFT OG SPECIALTEGN BLIVER HER ERSTATTET MED KORREKT HTML-KODE.
OrderMailText = Replace(OrderMailText, " ", " ", 1, -1, 1)
OrderMailText = Replace(OrderMailText, " ", " ", 1, -1, 1)
OrderMailText = Replace(OrderMailText, " ", " ", 1, -1, 1)
OrderMailText = Replace(OrderMailText, " ", " ", 1, -1, 1)
OrderMailText = Replace(OrderMailText, " ", " ", 1, -1, 1)
OrderMailText = Replace(OrderMailText, " ", " ", 1, -1, 1)
OrderMailText = Replace(OrderMailText, vbCrLf, "<br clear=" & chr(34) & "all" & chr(34) & ">" & vbCrLf, 1, -1, 1)
OrderMailText = Replace(OrderMailText, ">", ">")
OrderMailText = Replace(OrderMailText, "<", "<")
OrderMailText = Replace(OrderMailText, """, chr(32))
' -> ORDREN BLIVER HER UDSKREVET MED OVENSTÅENDE ERSTATNINGER.
Response.Write OrderMailText
End If
%></span></p>
</td>
</tr>
</table>
<!-- ORDRE HER - SLUT -->
</td>
</tr>
</table>
<%Else%><table align="center" border="0" cellpadding="0" cellspacing="0" width="440">
<tr>
<td align="left" valign="top" width="440">
<%=OrderFailed%>
</td>
</tr>
</table>
<center>
<p>- <a href="java script:history.go(-1);">TILBAGE</a> -</p>
</center>
<%End If%>
<%
rs.Close
Set rs = Nothing
myConn.Close
Set myConn = Nothing
Erase Kategorier
%>
</td>
</tr>
</table>
<!-- INDHOLD SLUT -->
<!-- TOM TABEL FOR AT GIVE MERE PLADS -->
<table align="center" border="0" cellpadding="0" cellspacing="0" width="600">
<tr>
<td align="left" valign="top" width="600">
<p> </p>
</td>
</tr>
</table>
<!-- FODNOTE START -->
<table align="center" border="0" cellpadding="0" cellspacing="0" width="600">
<tr>
<td align="center" valign="top" width="600">
<hr noshade size="1" width="100%">
<p><span class="small">| Alle produkter er fiktive og kun til demonstration |</span></p>
</td>
</tr>
</table>
<!-- FODNOTE SLUT -->
</body>
<head>
<meta http-equiv="expires" content="-1">
<meta http-equiv="pragma" content="no-cache">
</head>
</html>
FAQ:
<%
strHost = "smtp.danhost.dk"
If Request("Send") <> "" Then
Set Mail = Server.CreateObject("Persits.MailSender")
' enter valid SMTP host
Mail.Host = strHost
Mail.From = Request("From") ' From address
Mail.FromName = Request("FromName") ' optional
Mail.AddAddress Request("To")
' message subject
Mail.Subject = Request("Subject")
' message body
Mail.Body = Request("Body")
strErr = ""
bSuccess = False
On Error Resume Next ' catch errors
Mail.Send ' send message
If Err <> 0 Then ' error occurred
strErr = Err.Description
else
bSuccess = True
End If
End If
%>