%
' 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 TblConfig"
'Set the recordset object equal to the SQL query string
objRS.Open SQL, objADO, 1, 3
strKeywords = objrs("Keywords")
strDescription = objrs("MetaDescription")
strKeywords = ltrim(strKeywords)
'Retrieving form input and assigning to a variable
strKeywords2 = Request.Form("txtKeywords")
strDescription2 = Request.Form("txtDescription")
'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 strKeywords = "" or strDescription = "" 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
objrs("Keywords")= strKeywords2
objrs("MetaDescription")= strDescription2
objrs.update
warningErrMsg = "Your meta keywords / description have been saved. Please refresh your browser."
end if
end if
%>
MANAGE META KEYWORDS AND DESCRIPTION
Manage your meta keywords and description below. Search engines use these when listing your site.
<% if WarningErrMsg <> "" then %>| Message(s): <%= warningErrMsg %> |