I would like all of our intranet pages to provide a link to the site
owner... and when clicked the visitor should be able to send the owner
an email.
I was using ASP to do this (see below) but I would like to not have
use the .asp extension on all 70,000 of our pages...
Can i somehow get this (or similiar) functionality using javascript?
You will notice that a _siteinfo.txt file has to be dropped into each
directory for the code to work.
This code also generates a page last modified date... but I did figure
out how to get that info using javascript.
<%
Dim fso, fname, iname, imail, fpath
Dim tsin, ln, contactline, fp, pagefile, pagedate
' Format of _siteinfo.txt data file...
'CONTACT_NAME=Whitney Cali
'C**********************@whatever.com
Set fso = Server.CreateObject("Scripting.FileSystemObject")
fp = Request.ServerVariables("PATH_TRANSLATED")
fpath = fso.GetParentFolderName(fp)
fname = fpath + "\_siteinfo.txt"
If fso.FileExists(fname) Then
Set f = fso.GetFile(fname)
Set tsin = f.OpenAsTextStream(1, -2)
Do While Not tsin.AtEndOfStream
ln = tsin.ReadLine()
If Left(ln,12) = "CONTACT_NAME" Then
iname = Mid(ln,14)
End If
If Left(ln,13) = "CONTACT_EMAIL" Then
imail = Mid(ln,15)
End If
If Left(ln,13) = "CONTACT_PHONE" Then
iphone = Mid(ln,15)
End If
Loop
' Close filestream
tsin.Close
If imail <> "" And iname <> "" Then
contactline = "Site Owner: <a href='mailto:" & imail & "?subject=Web
Site Feedback'>" & _
iname & "</a> Phone: " & iphone
Else
contactline = ""
End If
Else
contactline = ""
End If
Set tsin = Nothing
Set pagefile = fso.GetFile(fp)
pagedate = pagefile.DateLastModified
Set pagefile = Nothing
Set fso = Nothing
pagename = Request.ServerVariables("PATH_INFO")
%>