954,174 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Simple action on string from form - ?

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 ofObject 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
%>
Ryujin
Newbie Poster
24 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: