943,195 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Unsolved
  • Views: 18
  • ASP RSS
Jul 24th, 2010
0

Simple action on string from form - ?

Expand Post »
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
  1. (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...

  1. <%
  2. permalink=Request.QueryString("permalink")
  3. If permalink<>"" Then
  4. Response.Write("http://navigator-kutztown.passhe.edu/login?url=" & permalink)
  5. End If
  6. %>
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Ryujin is offline Offline
22 posts
since Mar 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: Missing Operator error
Next Thread in ASP Forum Timeline: trim function





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC