Forum Moderators: open
I am looking for someone who can help me setup a last modified date to appear everytime spiders wander into my site. It seems, spiders will move on to sites that have recently been modified or have updates.
Someone passed me some codes to do this but I can't read them. I am looking to pay someone to help me with this. My site is in ASP.
Below are the codes:
<%
' Get the Id from the URL Encoded String
Id = Request("Id");
' Create a SQL Connection
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Example","sa",""
' Create SQL Statement
sql = "SELECT LastModified, Text FROM tblContent WHERE Id=" & Id
' Execute SQL Statement
Set RS = Conn.Execute(sql)
' Assign result set to variables
strText=RS("Text")
' Adjust From PST to GMT
dtModified = DateAdd ("h",7,dtModified)
If (Len(Request.ServerVariables("HTTP_IF_MODIFIED_SINCE"))) Then
strIfModifiedSince=Request.ServerVariables("HTTP_IF_MODIFIED_SINCE")
nIndex=InStr(1,strIfModifiedSince,";",vbTextCompare)
If (nIndex>0) Then
strIfModifiedSince=Left(strIfModifiedSince,nIndex-5)
Else
strIfModifiedSince=Left(strIfModifiedSince,Len(strIfModifiedSince)-5)
End If
nIndex=InStr(1,strIfModifiedSince," ",vbTextCompare)
If (nIndex>0) Then
strIfModifiedSince=Right(strIfModifiedSince,Len(strIfModifiedSince)-nIndex)
End If
dtDate=CDate(strIfModifiedSince)
If (Modified<=dtDate) Then
Response.Clear
Response.Status = "304 Not Modified"
Response.End
EndIIf
End If
dtModified=RS("LastModified")
' Clean Up
RS.close
ConnClose
' Construct Last Modified String
strModifed= WeekDayName(WeekDay(dtModified),TRUE) &_
", " & Day(dtModified) & " " &_
MonthName(Month(dtModified),TRUE) &_
" " & Year(dtModified) &" "& Hour(dtModified) &_
":" & Minute(dtModified) & ":" &_
Second(dtModified) & " GMT"
' Set the Last Modified Header
Response.AddHeader "Last-modified", strModifed
%>
Other than that, what exactly isn't working for you? Are you looking for someone who'd implement this practically for you? If yes, then I suggest you take a look at the commercial exchange forum here at WW. You can find plenty of good asp programmers there.
Good luck
//ZS