I have inherited a classic asp site which has a fairly robust custom cms. We have recently moved the site across to one of our hosting machines and have recently noticed some issues with getting values frmo functions in an include file (at least thats what I think is happening). There are a number of nested include files but I am sure that they are all being included correctly.
I am sure that the includes are functioning correctly as I have tested changing the path and it displays an error.
Here is the include code:
<!--#include virtual="/admin/core/functions/fncGlobal.asp" -->
The function I am trying to get a value from is:
Function FormatURL(ByRef in_str)
Dim BadChars, RepChars, NewString, i
NewString = Trim(in_str)
NewString = StripNonAlphaNum(NewString)
NewString = Trim(NewString)
NewString = Replace(NewString, " ", "-")
NewString = Replace(NewString, "----", "-")
NewString = Replace(NewString, "---", "-")
NewString = Replace(NewString, "--", "-")
FormatURL = LCase(NewString)
End Function
The function to strip alpha numeric characters:
Function StripNonAlphaNum(inString)
Dim oRE, strOutput, theString
If inString <> Null Then
inString = Replace(inString, "'", "")
inString = Replace(inString, "&", "")
inString = Replace(inString, "®", "")
inString = Replace(inString, "™", "")
inString = Replace(inString, "©", "")
inString = Replace(inString, ""e;", "")
Set oRE = New Regexp
oRE.Global = True
oRE.IgnoreCase = True
oRE.Pattern = "[\W_]"
strOutput = oRE.Replace(inString, " ")
StripNonAlphaNum = strOutput
Else
StripNonAlphaNum = ""
End If
End Function
I have tested returning a string from this function but still I get the same blank result.
I am testing the function like this:
Response.Write("Test URL: " & FormatURL("Format URL Title Test"))
The result I get is
Test URL:
Is there something obvious I am doing wrong? I'm not very experienced with ASP.