<% httprefer = Request.ServerVariables("HTTP_REFERER") If (left(httprefer,24) <> "http://www.invent.ru/ru/") And (left(httprefer,20) <> "http://invent.ru/ru/") Then RUSENG = 2 Else RUSENG = 1 dim ERPOLE(10,3) ERPOLE(1,1) = "Ваше имя" ERPOLE(1,2) = "Your name" ERPOLE(2,1) = "Должность" ERPOLE(2,2) = "Title" ERPOLE(3,1) = "Телефон" ERPOLE(3,2) = "Phone" ERPOLE(4,1) = "Название фирмы" ERPOLE(4,2) = "Firm name" ERPOLE(5,1) = "Город" ERPOLE(5,2) = "City" ERPOLE(6,1) = "Страна" ERPOLE(6,2) = "Country" ERPOLE(7,1) = "Эл. почта" ERPOLE(7,2) = "E-mail" ERPOLE(8,1) = "Суть вопроса" ERPOLE(8,2) = "Your question" ERPOLE(9,1) = "Заявка не отправлена. Причина: не заполнены одно или несколько полей, перечисленные ниже:" ERPOLE(9,2) = "Your message has not been completed. One or more required fields described below are not finished:" ERPOLE(10,1) = "Назад" ERPOLE(10,2) = "Back" If Request("yname") <> "" Then SNAME = trim(replace(Request("yname"),"'","")) Else ERPOLE(1,3) = ERPOLE(1,RUSENG) If Request("ytitle") <> "" Then STITUL = trim(replace(Request("ytitle"),"'","")) If Request("yphone") <> "" Then SPHONE = trim(replace(Request("yphone"),"'","")) Else ERPOLE(3,3) = ERPOLE(3,RUSENG) If Request("fname") <> "" Then SFIRM = trim(replace(Request("fname"),"'","")) Else ERPOLE(4,3) = ERPOLE(4,RUSENG) If Request("ycity") <> "" Then SCITY = trim(replace(Request("ycity"),"'","")) Else ERPOLE(5,3) = ERPOLE(5,RUSENG) If Request("ystate") <> "" Then SSTATE = trim(replace(Request("ystate"),"'","")) Else ERPOLE(6,3) = ERPOLE(6,RUSENG) If Request("ymail") <> "" Then SMAIL = trim(replace(Request("ymail"),"'","")) Else ERPOLE(7,3) = ERPOLE(7,RUSENG) If Request("yquery") <> "" Then SBODY = trim(replace(Request("yquery"),"'","")) Else ERPOLE(8,3) = ERPOLE(8,RUSENG) If len(SBODY) < 2 Then ERBODY = "true" SMAIL = TMAIL(SMAIL) If SMAIL = "" Then ERPOLE(7,3) = ERPOLE(7,RUSENG) If ERPOLE(1,3) & ERPOLE(3,3) & ERPOLE(4,3) & ERPOLE(5,3) & ERPOLE(6,3) & ERPOLE(7,3) & ERPOLE(8,3) <> "" Then %> INVENT Send a question ">





<%=ERPOLE(9,RUSENG)%>
<% For i = 1 to 8 If ERPOLE(i,3) <> "" Then Response.write(ERPOLE(i,3) & "
") Next %>
"> "> "> "> "> "> "> ">
<% Else Set CN = Server.CreateObject("ADODB.Connection") CN.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=TRUE;User ID=product;PASSWORD=product2000;Initial Catalog=prd;Data Source=127.0.0.1;Connect Timeout=180" if CN.State = adStateClosed then CN.OPEN SET RS=Server.CreateObject("ADODB.Recordset") RS.CacheSize = 10 RS.CursorLocation = 3'adUseClient HAddr = Request.ServerVariables("REMOTE_ADDR") SQLINVENT = "Insert into EMAIL_INVENT (NAME, TITUL, PHONE, FNAME, CITY, COUNTRY, MAILFROM, BODY, IP) " & _ "Values ('" & SNAME & "', " & _ "'" & STITUL & "', " & _ "'" & SPHONE & "', " & _ "'" & SFIRM & "', " & _ "'" & SCITY & "', " & _ "'" & SSTATE & "', " & _ "'" & SMAIL & "', " & _ "'" & left(SBODY,7200) & "', " & _ "'" & HAddr & "')" RS.Open SQLINVENT, CN, adOpenForwardOnly ' Response.write SQLINVENT TOBODY = "Имя: " & SNAME & chr(10) TOBODY = TOBODY & "Должность: " & STITUL & chr(10) TOBODY = TOBODY & "Телефон: " & SPHONE & chr(10) TOBODY = TOBODY & "Название фирмы: " & SFIRM & chr(10) TOBODY = TOBODY & "Город: " & SCITY & chr(10) TOBODY = TOBODY & "Страна: " & SSTATE & chr(10) TOBODY = TOBODY & "Эл. почта: " & SMAIL & chr(10) & chr(10) TOBODY = TOBODY & left(SBODY,7200) TOSUBJ = "От: " & SNAME & ", " & SFIRM TOMAIL = "info@invent.ru" SSSSSS = SENDMAIL(TOMAIL,SMAIL,TOSUBJ,TOBODY) Set CN=Nothing Response.redirect "sentok.htm" End If Function SENDMAIL(MTO, MFROM, SUBJ, BODY) Set SmtpRus = Server.CreateObject("smtprus.smtprus.1") SmtpRus.Host = "mx3.product.ru" SmtpRus.Port = "25" SmtpRus.From = MFROM SmtpRus.To = MTO SmtpRus.Charset = "koi8-r" SmtpRus.Subject = SUBJ SmtpRus.Body = BODY SmtpRus.SendLetter End Function Function TMAIL(strng) If strng <> "" Then strng = trim(strng) If (right(strng,1) = ",") Or (right(strng,1) = ";") Then strng = trim(left(strng,len(strng)-1)) If ((left(strng,1) = "-") Or (left(strng,1) = "_") Or ((asc(lcase(left(strng,1))) > 96) And (asc(lcase(left(strng,1))) < 123)) Or ((asc(lcase(left(strng,1))) >= 48) And (asc(lcase(left(strng,1))) <= 57))) And ((asc(lcase(right(strng,1))) > 96) And (asc(lcase(right(strng,1))) < 123)) Then Dim S, regExT, regEx, Match, Matches Set regExT = New RegExp regExT.Pattern = "^[a-z0-9]?([\w-]+\.?)+@([\w-]+\.)+[a-z]{2,4}$" regExT.IgnoreCase = True Set regEx = New RegExp regEx.Pattern = "([\w\.\-@]+)([\s]?|$)" regEx.IgnoreCase = True regEx.Global = True Set Matches = regEx.Execute(strng) For Each Match in Matches ' response.write "+" & Match.Value & "+" S = trim(Match.Value) if regExT.Test(S) Then If RetStr = "" Then RetStr = S Else RetStr = RetStr & "; " & S End If Else RetStr = "" exit for End If Next TMAIL = RetStr Else TMAIL = "" End If End If End Function %>