Retrieving the redirected URL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mbewers1
    New Member
    • Feb 2009
    • 68

    Retrieving the redirected URL

    Hi there, is it possible to retrieve the URL of a webpage which a user has been redirected to using some tags in ASP?

    I'm building a site where the user is redirected to an external webpage when they select a button. This external page is almost always different each time.

    I have been able to embed a redirect using:

    <form method="POST" action="http://dx.doi.org" runat="server">
    <input type="submit"/>

    but I don't know how I could code some sort of a method="GET" using a dynamic URL.
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    don't you have some kind of get method and in that can't you add some kind of response.redire ct(url)?

    Comment

    • mbewers1
      New Member
      • Feb 2009
      • 68

      #3
      Yes, but that takes you to a "known" url.
      I want to find a way to retrieve a url which is unknown until a user is redirected to it. Anyway, after talking about this with my supervisor, it seems that this is possible with an
      Code:
      <a href= "" >
      tag, but I'm not so sure as according to:

      W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.


      this tag is a hyperlink.

      Comment

      • RedSon
        Recognized Expert Expert
        • Jan 2007
        • 4980

        #4
        How can you redirect a user to an unknown URL that is not known until the user is redirected to it? Do you not see the circular logic in that?

        Comment

        • mbewers1
          New Member
          • Feb 2009
          • 68

          #5
          I don't want to "re-direct" them to an unknown URL, I want to be able to retrieve the url of a site they have been moved to. Here's the plan?

          1. Enter information into text box.
          2. Click on submit button.
          3. Retrieve the resulting url that a user would have been redirected to if they had used the DOI website http://dx.doi.org/
          4. Do stuff with the URL retrieved from step 2 e.g. read text, look for strings, look for pictures, etc.

          I don't know if this is possible with html and/or C#.
          I am developing the site in C#

          Comment

          • RedSon
            Recognized Expert Expert
            • Jan 2007
            • 4980

            #6
            You are writing a web proxy? When someone enters in whatever a "doi" is you want to navigate to that site and download it?

            Also, as a side note, you realise that doi is an alternate spelling of the word "doy" (http://www.urbandictionary.com/define.php?term=doy)

            Comment

            • mbewers1
              New Member
              • Feb 2009
              • 68

              #7
              No I'm not redirecting to a web proxy or downloading the doi, just screen scraping the site that it redirects to, which is unknown until the user redirects to it.

              Comment

              • jhardman
                Recognized Expert Specialist
                • Jan 2007
                • 3405

                #8
                the standard method is to redirect to a page within your website first, track where they are going, then send them on their way. Does this make sense?

                Jared

                Comment

                • GazMathias
                  Recognized Expert New Member
                  • Oct 2008
                  • 228

                  #9
                  A couple of ideas. Not sure exactly how the dynamics of what you want to do work, but:

                  Use the microsoft.xmlht tp object to return the results page of the doi lookup and parse (if the page isn't automatically redirected by the lookup), then redirect them yourself.

                  Open the doi page in a frame, use javascript to grab the url of the page they get redirected to within the frame.

                  May be grasping at straws a bit there.

                  Gaz,

                  Comment

                  Working...