<% Response.Expires = 0 Response.Buffer = True 'Retrieving form input and assigning to a variable 'txtLastName is the name of the text box on the form strName = Request.Form ("txtName") strCity = Request.Form("txtCity") strTestimonial = Request.Form("txtTestimonial") strDate = Date() 'This code only runs if the submit button is clicked if Request.Form <> "" then 'Sets an error message if any required fields are left blank if strName = "" or strCity = "" or strTestimonial = "" then WarningErrMsg = "All fields are required." end if 'If error message was not set, then all error checks were passed; Connect to the database if warningErrMsg = "" then ' Create a recordset object to store specific table information Set objRS = Server.CreateObject("ADODB.Recordset") 'Establish what records you want selected for the SQL query string SQL = "Select * From TblTestimonials" 'Set the recordset object equal to the SQL query string objRS.Open SQL, objADO, 1, 3 objRs.addnew objRs.Fields("Name") = strName objRs.Fields("City") = strCity objRs.Fields("Testimonial") = strTestimonial objRs.Fields("Date") = strDate objRs.update warningErrMsg = "Testimonial added successfully." end if end if %>

ADD A TESTIMONIAL

Please fill out the form below to add a new testimonial.
All fields are required

<% if WarningErrMsg <> "" then %>
Message(s):
<%= warningErrMsg %>
<% end if %>
Name:
City:
Testimonial:
Maximum Number of characters is 255.

You have 255 characters remaining for your description...