% if Request.Form("submit") = "Build Your Page" then sRestrict = "" for i = 2 to 4 if Request.Form("restrictions" + cStr(i)) = "" then sRestrict = sRestrict + "0" else sRestrict = sRestrict + "1" end if NEXT sRestrict = sRestrict + Request.Form("restrictions1") if Request.Form("contact") = "yes" then sContact = "1" else sContact = "0" end if if Request.Form("orders") = "yes" then sContact = "2" end if if (not Request.Form("website") = "") and (not instr(Request.Form("website"), "http://") > 0) then sURL = "http://" + Request.Form("website") end if if Request.Form("expires") = "monthly" then sExpires = cStr(DateAdd("m", cInt(Request.Form("count_month")), Date)) else sExpires = Request.Form("month") + "/" + Request.Form("day") + "/" + cStr(DatePart("yyyy", Date)) if not isDate(sExpires) then sExpires = cStr(Date) else if DateDiff("d", Date,sExpires) < 0 then sExpires = cStr(DateAdd("yyyy", 1, sExpires)) end if end if end if SET DbObj = Server.CreateObject("ADODB.CONNECTION") DbObj.Open "DSN=CommunityRebates;"+application("SQLQuery") SQL = "INSERT INTO hosting (name, user_pwd, address, address2, city, state, zip_code, phone, fax, email, website, category1, category2, category3, contact, slogan, specials, expires, comment, restrictions, title_font, page_font, font_color, background_color, finder_rec_id, merchant_type, active) VALUES ('"+Replace(Request.Form("name"), "'", "''")+"', '"+Request.Form("password")+"', '"+Request.Form("address")+"', '"+Request.Form("address2")+"', '"+Request.Form("city")+"', '"+Request.Form("state")+"', '"+Request.Form("zip_code")+"', '"+Request.Form("phone")+"', '"+Request.Form("fax")+"', '"+Request.Form("email")+"', '"+sURL+"', '"+Request.Form("category1")+"', '"+Request.Form("category2")+"', '"+Request.Form("category3")+"', '"+sContact+"', '"+Replace(Request.Form("slogan"), "'", "''")+"', '"+Replace(Request.Form("specials"), "'", "''")+"', '"+sExpires+"', '"+Replace(Request.Form("comment"), "'", "''")+"', '"+Replace(sRestrict, "'", "''")+"', '"+Request.Form("title_font")+"', '"+Request.Form("page_font")+"', '"+Request.Form("font_color")+"', '"+Request.Form("background_color")+"', '0', '"+Request.Form("merchant_type")+"', '1')" SET oRs = DbObj.Execute(SQL) SQL = "SELECT rec_id, name FROM hosting WHERE replace(name, ' ', '') = '"+Replace(Replace(Request.Form("name"), " ", ""), "'", "''")+"' and user_pwd = '"+Request.Form("password")+"'" SET oRs = DbObj.Execute(SQL) if not oRs.EOF then Response.Cookies("UI") = oRs.Fields("rec_id") Response.Cookies("UN") = oRs.Fields("name") end if set oRs = Nothing DbObj.close set DbObj = Nothing Response.Redirect(Replace(Request.Form("name"), " ", "")) end if if Request.Form("submit") = "Click To Continue" then if Request.Form("password") = Request.Form("re-password") then SET DbObj = Server.CreateObject("ADODB.CONNECTION") DbObj.Open "DSN=CommunityRebates;"+application("SQLQuery") SQL = "SELECT rec_id from hosting WHERE replace(name, ' ', '') = '"+Replace(Replace(Request.Form("name"), "'", "''"), " ", "")+"'" SET oRs = DbObj.Execute(SQL) if not oRs.EOF then sUserError = "*Sorry this business name is aready in use." bError = TRUE else sUser = Request.Form("name") end if set oRs = Nothing DbObj.close set DbObj = Nothing else bError = TRUE sPassError = "*Passwords do not match." end if end if %>