% Option Explicit %> <% Dim iOrderID 'as integer Dim iAffNUM 'as integer Dim iAction 'as integer Dim iRet 'as integer Dim sContactName 'as string Dim sBookCode 'as string Dim sCoverStyle 'as string Dim sBookQuantity 'as string Dim sMFirstName 'as string -- main character Dim sMLastName 'as string Dim sMGender 'as string Dim sMAge 'as string Dim sMHairColor 'as string Dim sMHairLength 'as string Dim sMHairStyle 'as string Dim sMEyeColor 'as string Dim sMAddress 'as string Dim sMPet 'as string Dim sMPetName 'as string Dim sFFirstName 'as string -- friend character Dim sFGender 'as string Dim sFHairColor 'as string Dim sFHairLength 'as string Dim sFHairStyle 'as string Dim sFEyeColor 'as string Dim sAName 'as string -- adult character Dim sAGender 'as string Dim sCFirstName 'as string -- contact / payment info Dim sCLastName 'as string Dim sCAddress 'as string Dim sCCity 'as string Dim sCState 'as string Dim sCZipCode 'as string Dim sCCountry 'as string Dim sCCountry2 'as string Dim sCHomePhone 'as string Dim sCWorkPhone 'as string Dim sCFax 'as string Dim sCEmail 'as string Dim sCardType 'as string Dim sCardNumber 'as string Dim sCardExpiry 'as string Dim sDelivery 'as string Dim sSFirstName 'as string -- shipping info Dim sSLastName 'as string Dim sSAddress 'as string Dim sSCity 'as string Dim sSState 'as string Dim sSZipCode 'as string Dim sSCountry 'as string Dim sSCountry2 'as string Dim sComputer 'as string Dim sUsername 'as string Dim sBrowser 'as string Dim sSQL 'as string Dim sMessage 'as string Dim sSubject 'as string Dim sBody 'as string Dim oConn 'as connection Dim RecordSet 'as record set '-- iOrderID = 0 '-- iAction = Request("a") IF iAction = 1 THEN sMFirstName = Request.Form("heroinefirstname") sMLastName = Request.Form("heroinelastname") sMGender = Request.Form("heroinegender") sMAge = Request.Form("heroineage") sMHairColor = Request.Form("heroinehaircolor") sMHairLength = Request.Form("heroinehairlength") sMHairStyle = Request.Form("heroinehairstyle") sMEyeColor = Request.Form("heroineeyecolor") sMAddress = Request.Form("heroineaddress") sMPet = Request.Form("pet") sMPetName = Request.Form("petname") sFFirstName = Request.Form("herofirstname") sFGender = Request.Form("herogender") sFHairColor = Request.Form("herohaircolor") sFHairLength = Request.Form("herohairlength") sFHairStyle = Request.Form("herohairstyle") sFEyeColor = Request.Form("heroeyecolor") sAName = Request.Form("friendlastname") sAGender = Request.Form("friendgender") sCoverStyle = Request.Form("cover") sBookQuantity = Request.Form("quantity") sCFirstName = Request.Form("contactfirstname") sCLastName = Request.Form("contactlastname") sCAddress = Request.Form("contactstreetaddress") sCCity = Request.Form("contactcity") sCState = Request.Form("contactstate") sCZipCode = Request.Form("contactzipcode") sCCountry = Request.Form("country") sCCountry2 = Request.Form("othercountry") sCHomePhone = Request.Form("homephone") sCWorkPhone = Request.Form("workphone") sCFax = Request.Form("contactfax") sCEmail = Request.Form("contactemail") sCardType = Request.Form("card") sCardNumber = Request.Form("cardnumber") sCardExpiry = Request.Form("cardmonth") & "/" & Request.Form("cardyear") sDelivery = Request.Form("deliverymethod") sSFirstName = Request.Form("alternatefirstname") sSLastName = Request.Form("alternatelastname") sSAddress = Request.Form("alternatestreetaddress") sSCity = Request.Form("alternatecity") sSState = Request.Form("alternatestate") sSZipCode = Request.Form("alternatezipcode") sSCountry = Request.Form("alternatecountry") sSCountry2 = Request.Form("alternateothercountry") sBookCode = Request.Form("productid") iAffNUM = Request.Form("ID") sComputer = Request.ServerVariables("REMOTE_ADDR") sUsername = Request.ServerVariables("LOGON_USER") sBrowser = Request.ServerVariables("USER_AGENT") '-- open database connection Set oConn = dbOpenConnection(g_DSN) '-- sSQL = "INSERT INTO orders (heroinefirstname, heroinelastname, heroinegender, heroineage, heroinehaircolor, " &_ "heroinehairlength, heroinehairstyle, heroineeyecolor, heroineaddress, pet, petname, herofirstname, herogender, herohaircolor, " &_ "herohairlength, herohairstyle, heroeyecolor, friendlastname, friendgender, cover, quantity, contactfirstname, contactlastname, " &_ "contactstreetaddress, contactcity, contactstate, contactzipcode, country, othercountry, homephone, workphone, " &_ "contactfax, contactemail, card, cardnumber, cardexpiry, deliverymethod, alternatefirstname, alternatelastname, " &_ "alternatestreetaddress, alternatecity, alternatestate, alternatezipcode, alternatecountry, alternateothercountry, " &_ "productid, ordertime, computername, username, browser, affiliateNUM) VALUES ('" & FixSQL(sMFirstName) & "', '" &_ FixSQL(sMLastName) & "', '" & sMGender & "', '" & sMAge & "', '" & sMHairColor & "', '" & sMHairLength & "', '" &_ sMHairStyle & "', '" & sMEyeColor & "', '" & FixSQL(sMAddress) & "', '" & FixSQL(sMPet) & "', '" &_ FixSQL(sMPetName) & "', '" & FixSQL(sFFirstName) & "', '" &_ sFGender & "', '" & sFHairColor & "', '" & sFHairLength & "', '" & sFHairStyle & "', '" & sFEyeColor & "', '" &_ FixSQL(sAName) & "', '" & sAGender & "', '" & FixSQL(sCoverStyle) & "', '" & FixSQL(sBookQuantity) & "', '" & FixSQL(sCFirstName) & "', '" &_ FixSQL(sCLastName) & "', '" & FixSQL(sCAddress) & "', '" & FixSQL(sCCity) & "', '" & FixSQL(sCState) & "', '" &_ FixSQL(sCZipCode) & "', '" & FixSQL(sCCountry) & "', '" & FixSQL(sCCountry2) & "', '" & FixSQL(sCHomePhone) & "', '" &_ FixSQL(sCWorkPhone) & "', '" & FixSQL(sCFax) & "', '" & sCEmail & "', '" & sCardType & "', '" & sCardNumber & "', '" &_ sCardExpiry & "', '" & FixSQL(sDelivery) & "', '" & FixSQL(sSFirstName) & "', '" & FixSQL(sSLastName) & "', '" &_ FixSQL(sSAddress) & "', '" & FixSQL(sSCity) & "', '" & FixSQL(sSState) & "', '" & FixSQL(sSZipCode) & "', '" &_ FixSQL(sSCountry) & "', '" & FixSQL(sSCountry2) & "', '" & sBookCode & "', #" & Now() & "#, '" & sComputer & "', '" &_ sUsername & "', '" & sBrowser & "', '" & FixSQL(iAffNUM) & "');" oConn.Execute(sSQL) IF Err.Number = 0 THEN sSQL = "SELECT @@IDENTITY As NewID" Set RecordSet = oConn.Execute(sSQL) IF NOT RecordSet.EOF THEN iOrderID = RecordSet(0).Value END IF Set RecordSet = Nothing ELSE '-- errors probably occured END IF IF iOrderID > 0 THEN sContactName = sCFirstName & " " & sCLastName sSubject = "Two Children and It - Order Confirmation" sBody = "
" sBody = sBody & FormatOrderConfirmation(iOrderID, sContactName, sBookCode, sDelivery) sBody = sBody & "" iRet = SendMail("publish@bookbyyou.com", sCEmail, "", "", sSubject, sBody, TRUE) Response.Redirect("/confirmation/TCIconfirmation.asp?oid=" & iOrderID) END IF '-- clean up oConn.Close Set oConn = Nothing END IF %>