1) Jeg har en udbyder der hedder buydomain.dk
2) script:
<%@ Language=VBScript %>
<%
%>
<% pageTitle = "Validate Order" %>
<!--#include file="adovbs.inc"-->
<!--#include file="db.asp"-->
<font face="Arial">
<%
'displays header on form field validation pages
function displayHeader()
Response.Write "<html>"
Response.Write "<head>"
Response.Write "<body>"
Response.Write "<table border='0'>"
Response.Write "<tr>"
Response.Write "<td valign='middle' nowrap>"
Response.Write "</td>"
Response.Write "</tr>"
Response.Write "</table>"
Response.Write "<hr color='#cccccc' size='1' noshade>"
Response.Write "<div align = 'center'>"
end function
'Validate user entries in form fields and generate error pages
For Each key in Request.Form
strName = key
strValue = Request.Form(key)
Session(strName) = strValue
Next
strFirst = Request.Form("strFirst")
strLast = Request.Form("strLast")
strEmail = Request.Form("strEmail")
strAddress1 = Request.Form("strAddress1")
strAddress2 = Request.Form("strAddress2")
strCity = Request.Form("strCity")
strState = Request.Form("strState")
strPostalCode = Request.Form("strPostalCode")
strCountry = Request.Form("strCountry")
strPhone = Request.Form("strPhone")
strShipFirst = Request.Form("strShipFirst")
strShipLast = Request.Form("strShipLast")
strShipAddress = Request.Form("strShipAddress")
strShipCity = Request.Form("strShipCity")
strShipState = Request.Form("strShipState")
strShipPostalCode = Request.Form("strShipPostalCode")
strShipCountry = Request.Form("strShipCountry")
strShipMethod = Request.Form("strShipMethod")
If strFirst = "" then
displayHeader()
Response.Write "<font size='4'><b>" & "Du skal indtaste fornavn." & "</b><br><br>" & "<font size='2'>" & "Press your browser's " & "<b>back button</b> " & "to return to form." & "<br><br>"
Response.Write "<hr color='#cccccc' size='1' noshade>"
Response.End
end if
If strLast = "" then
displayHeader()
Response.Write "<font size='4'><b>" & "Du skal indtaste efternavn." & "</b><br><br>" & "<font size='2'>" & "Press your browser's " & "<b>back button</b> " & "to return to form." & "<br><br>"
Response.Write "<hr color='#cccccc' size='1' noshade>"
Response.End
end if
If strEmail = "" OR len(strEmail) <=7 then
displayHeader()
Response.Write "<font size='4'><b>" & "Please enter your email address: e.g., (name@yourDomain.com)." & "</b><br><br>" & "<font size='2'>" & "Press your browser's " & "<b>back button</b> " & "to return to form." & "<br><br>"
Response.Write "<hr color='#cccccc' size='1' noshade>"
Response.End
end if
If strEmail = "" Or instr(strEmail, "@") = 0 then
displayHeader()
Response.Write "<font size='4'><b>" & "Please enter your email address: e.g., (name@yourDomain.com)." & "</b><br><br>" & "<font size='2'>" & "Press your browser's " & "<b>back button</b> " & "to return to form." & "<br><br>"
Response.Write "<hr color='#cccccc' size='1' noshade>"
Response.End
end if
If strAddress1 = "" OR len(strAddress1) <=7 then
displayHeader()
Response.Write "<font size='4'><b>" & "Du skal indtaste gadenavn" & "</b><br><br>" & "<font size='2'>" & "Press your browser's " & "<b>back button</b> " & "to return to form." & "<br><br>"
Response.Write "<hr color='#cccccc' size='1' noshade>"
Response.End
end if
If strAddress2 = "" OR len(strAddress2) <2 then
displayHeader()
Response.Write "<font size='4'><b>" & "Please enter your P.O. Box or Rural Route No. Enter 'NA' if not applicable." & "</b><br><br>" & "<font size='2'>" & "Press your browser's " & "<b>back button</b> " & "to return to form." & "<br><br>"
Response.Write "<hr color='#cccccc' size='1' noshade>"
Response.End
end if
If strCity = "" OR len(strCity) <=2 then
displayHeader()
Response.Write "<font size='4'><b>" & "Du skal indtaste by" & "</b><br><br>" & "<font size='2'>" & "Press your browser's " & "<b>back button</b> " & "to return to form." & "<br><br>"
Response.Write "<hr color='#cccccc' size='1' noshade>"
Response.End
end if
If strState = "" OR len(strState) <=1 then
displayHeader()
Response.Write "<font size='4'><b>" & "Please enter your state or province." & "</b><br><br>" & "<font size='2'>" & "Press your browser's " & "<b>back button</b> " & "to return to form." & "<br><br>"
Response.Write "<hr color='#cccccc' size='1' noshade>"
Response.End
end if
If strPostalCode = "" OR len(strPostalCode) <4 then
displayHeader()
Response.Write "<font size='4'><b>" & "Du skal indtaste postnr." & "</b><br><br>" & "<font size='2'>" & "Press your browser's " & "<b>back button</b> " & "to return to form." & "<br><br>"
Response.Write "<hr color='#cccccc' size='1' noshade>"
Response.End
end if
If strCountry = "" OR len(strCountry) <2 then
displayHeader()
Response.Write "<font size='4'><b>" & "Du skal indtaste land" & "</b><br><br>" & "<font size='2'>" & "Press your browser's " & "<b>back button</b> " & "to return to form." & "<br><br>"
Response.Write "<hr color='#cccccc' size='1' noshade>"
Response.End
end if
If strPhone = "" OR len(strPhone) < 8 then
displayHeader()
Response.Write "<font size='4'><b>" & "Du skal indtaste dit telefon nummer" & "</b><br><br>" & "<font size='2'>" & "Klik på " & "<b>tilbage knappen</b> " & "for at rette din bestilling" & "<br><br>"
Response.Write "<hr color='#cccccc' size='1' noshade>"
Response.End
end if
%>
</font>
<%
set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open ConString
intOrderID = Request.form("intOrderID")
set rsOrder = Server.CreateObject("ADODB.Recordset")
rsOrder.Open "SELECT * FROM orders WHERE orderID = " _
& intOrderID, Conn, adOpenStatic, adLockOptimistic, _
adCmdText
if rsOrder.EOF then
Response.Write "Der er opstået et problem med din bestilling "
Response.Write "Kontakt venligst Nordsjællands Serviceudlejning."
else
rsOrder("sAmt") = Request.form("intShipping")
rsOrder("tax") = Request.form("intTax")
rsOrder("fName") = Request.form("strFirst")
rsOrder("lName") = Request.form("strLast")
rsOrder("email") = Request.form("strEmail")
rsOrder("address1") = Request.form("strAddress1")
rsOrder("address2") = Request.form("strAddress2")
rsOrder("city") = Request.form("strCity")
rsOrder("state") = Request.form("strState")
rsOrder("postalcode") = Request.form("strPostalCode")
rsOrder("country") = Request.form("strCountry")
rsOrder("phone") = Request.form("strPhone")
rsOrder("sfName") = Request.form("strShipFirst")
rsOrder("slName") = Request.form("strShipLast")
rsOrder("sAddress") = Request.form("strShipAddress")
rsOrder("sCity") = Request.form("strShipCity")
rsOrder("sState") = Request.form("strShipState")
rsOrder("sPostalcode") = Request.form("strShipPostalCode")
rsOrder("sCountry") = Request.form("strShipCountry")
rsOrder("sMethod") = Request.form("strShipMethod")
rsOrder("total") = Request.form("intTotal")
rsOrder("orderDate") = Date
rsOrder("status") = "COMPLETE"
rsOrder.Update
Conn.Execute("DELETE FROM itemsOrdered WHERE " _
& "orderID = " & intOrderID)
set rsItem = Server.CreateObject("ADODB.Recordset")
rsItem.Open "itemsOrdered", Conn, adOpenStatic, adLockOptimistic, adCmdTable
for each item in Request.form("strOrderItem")
strOrderItem = cstr(item)
itemInfo = split(strOrderItem, ",")
rsItem.addNew
rsItem("orderID") = intOrderID
rsItem("productID") = itemInfo(0)
rsItem("quantity") = itemInfo(1)
rsItem.Update
next
rsItem.Close
set rsItem = Nothing
Session.abandon
end if
rsOrder.Close
set rsOrder = Nothing
Conn.Close
set Conn = Nothing
%>
<html>
<head>
<meta name="GENERATOR" Content="Microsoft Visual Studio 6.0">
<title><%= pageTitle %></title>
>
</head>
<body bgcolor="#ffffff" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" text="#808080">
<basefont face="Verdana" size="2">
<table border="0" width="100%" cellpadding="4" cellspacing="1">
<tr>
<td valign="bottom" nowrap align="right"><font face="Verdana" size="1"> </font></td>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#FFFFFF">
<tr>
<td bgcolor="#666666" height="20" align="left" valign="middle" nowrap colspan="4"> <font color="#FFFFFF" face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><a style="color: #FFFFFF; text-decoration: none" href="
http://www.metalinks.com/default.htm"><img src="images/icon.gif" border="0" align="middle" WIDTH="16" HEIGHT="16"> Startside</a> |
<b> <a href="default.asp" style="color:#FFFFFF;text-decoration:none;">e-bestilling Startside</a> |
<a href="mailto:webmaster@yourdomain.com" style="color:#FFFFFF;text-decoration:none;">Customer
Service</a> </b></font></td>
</tr>
</table>
<hr color="#CCCCCC" size="1" noshade>
<table border="0" bgcolor="#FFFFFF" cellpadding="0" cellspacing="0" width="625">
<tr>
<td width="128" valign="top" align="center">
<table border="0" cellspacing="4" cellpadding="4" width="125">
<tr>
</tr>
</table>
<td width="1" bgcolor="#000000"><img src="images/spacer.gif" width="1" height="1" alt border="0"></td>
<td align="center" valign="middle"><table border="0" cellspacing="4" cellpadding="4"><tr><td align="center">
<font face="Arial" size="4"><b>
Din bestilling er modtaget.<br> Du vil blive kontaktet i løbet af få dage.</font>
</td>
</tr>
</table>
</p>
<p><font face="Arial" size="4"><b>Tak for din bestilling</b></font></p>
</td>
</tr>
</table>
</td>
</tr>
</table>
<hr color="#CCCCCC" size="1" noshade>
<table border="0" cellpadding="0" cellspacing="6" width="100%">
<tr>
<td colspan="3" valign="BOTTOM"><font face="Verdana, Arial, Helvetica" size="1">
</td>
<td colspan="3" align="right" valign="TOP">
</td>
</tr>
</table>
</body>
</html>