%
Dim Name1, Date1, Email, Location, Request1, Service, Statement, Outcome
Dim Conn, ConnRec
Dim ix, field, inputvalue, theDims, message, required, requiredm, theString, FormAction
Name1 = Request.Form("Name1")
Date1 = Request.Form("Date1")
Email = Request.Form("Email")
Location = Request.Form("Location")
Request1 = Request.Form("Request1")
Service = Request.Form("Service")
Statement = Request.Form("Statement")
Outcome = Request.Form("Outcome")
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=SQLOLEDB; Data Source = 192.168.201.111; Intitial Catalog = Eastco_Comment; User Id =Eastco; Password=eastco;Network Library=DBMSSOCN"
Set connRec = server.CreateObject("ADODB.Recordset")
connRec.ActiveConnection = conn
connRec.open "Insert Into Comment (Name1, Date1, Email, Location, Request1, Service, Statement, Outcome) values ('" & Name1 & "','" & Date1 & "','" & Email & "','" & Location & "','" & Request1 & "','" & Service & "','" & Statement & "','" & Outcome & "')"
FormAction = ""
if ucase(request.servervariables("request_method")) = "POST" then
'now get the form values
For ix = 1 to Request.Form.Count
field = request.form.key(ix)
inputvalue = request.form.item(ix)
TheString = field & "= Request.Form(""" & field & """)"
Execute(TheString)
next
For ix = 1 to Request.Form.Count
field = Request.Form.Key(ix)
InputValue = Request.Form.Item(ix)
if trim(InputValue) = "" then
required = Field
if required = "Statement" then required = "" end if
if required <> "" then
exit for
end if
end if
Next
if email <> "" and instr(email,"@") = 0 then
required = "emailat"
elseif email <> "" and instr(email,".") = 0 then
required = "emaildot"
elseif email <> "" and instr(email,"www.") > 1 then
required = "emailwww"
end if
if required <> "" then
requiredm = ucase(left(required,1)) & mid(required,2)
select case required
case "emailat"
message = "Email addresses must contain the @ character, eg. you@example.com"
case "emaildot"
message = "Email addresses must contain the . character, eg. you@example.com"
case "emailwww"
message = "Email addresses do not contain www, eg. you@example.com"
case else
message = requiredm & " is required"
end select
if instr(required,"email")>0 then
required = "email"
end if
FormAction = "#" & required
else
'process the data
message = "Data submission successful"
end if
if message <> "" then
%>
<%
message = "
" & message & "
"
end if
end if
%>
|
 |
| We care about what you think |
In order for us to better serve you, please provide the information below. This information will only be used by Eastco Enterprises to provide you with better customer service – it will not be shared with any persons or groups outside of Eastco. Thank you. |
|
|
310 Troy Street • Dayton, OH 45404 • 937.531.7000
Copyright © 2007 Eastco Enterprises. All rights reserved. |
|
|