Ryujin 27 Newbie Poster

We have an ultra-simple tool for library database users. It adds a prefix to a given URL to create a link that works with our library's proxy server.

Our fear is that some users will inadvertently give it URLs that already have the prefix, as a few of our research databases do supply those. So in such a case we'd like the script to detect the presence of that prefix and return the given URL without adding anything.

Sounds simple but I don't have a clue! I've tried to get started using the C# substring method, with something like

(permalink.Substring(0, 46))

to create a variable that would be compared, using the String.Equals method, to the standard prefix; if they match, then the script would just write back the entered URL without prepending the prefix string.

My clumsy efforts at extracting that substring, though, have gotten me nothing more than a bunch of Object Required: "whatever's entered" errors.

The script is below. Thanks in advance for any pointers...

<%
permalink=Request.QueryString("permalink")
If permalink<>"" Then
     Response.Write("http://navigator-kutztown.passhe.edu/login?url=" & permalink)     
End If
%>