Forum Moderators: open
<%
Dim FileObj
Set FileObj = Server.CreateObject ("LastMod.FileObj")
FileObj.TimeFormat = ""
FileObj.DateFormat = "ddd, mmm d yyyy"
Response.Write "This page was last modified by Matt" & FileObj.LastModified (server.mappath(Request.ServerVariables("PATH_INFO"))) &"<br>"
%>
I want my name to launch a blank email (like using <a href="mailto:matt@example.com">Matt</a>)
Obviously straight HTML won't work, so what would I have to add to the code to make this work?
[edited by: Xoc at 5:30 pm (utc) on Dec. 7, 2004]
[quote]<%
Dim FileObj
Set FileObj = Server.CreateObject ("LastMod.FileObj")
FileObj.TimeFormat = ""
FileObj.DateFormat = "ddd, mmm d yyyy" Response.Write "This page was last modified by <a href=""mailto:matt@example.com"">Matt</a>) " & FileObj.LastModified(Server.MapPath(Request.ServerVariables("PATH_INFO"))) &"<br>"
%>[/quote]
...or if you're not really a big fan of inline Response.Write's (I know I'm not)...
[quote]<%
Dim FileObj
Set FileObj = Server.CreateObject ("LastMod.FileObj")
FileObj.TimeFormat = ""
FileObj.DateFormat = "ddd, mmm d yyyy"
%>
This page was last modified by <a href="mailto:matt@example.com">Matt</a>)
<%= FileObj.LastModified(Server.MapPath(Request.ServerVariables("PATH_INFO"))) %><br>[/quote] ...either way remember to Set FileObj = Nothing when you're done.
- Tony
[edited by: Xoc at 5:31 pm (utc) on Dec. 7, 2004]
Normally a double quote acts as a delimiter for a string, so having one part way through a string would causes the ASP engine to raise an error because it would encounter that quote and assume the string had ended and that the rest of the string belonged to something else.
By using a pair of quotes you "encode" the quote, implying that you want it to be part of the content of the string rather than a delimiter.
- Tony