SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict
    Join Date
    Dec 2005
    Posts
    381
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Get Variable from redirect link, is this possible?

    I'm a total newbie when it comes to ASP. I use alot of PHP but I've now came up against a problem which I think will have to use asp to fix it.

    I need to get the internet based software KMailer to send a users email address as a variable to a webpage. Basically the webpage uses the persons email address to decide what data to display.

    I have emailled the software support people but they don't seem to understand my request. The link that I input into the email gets sent to a redirect.asp page, I'm presuming so that the reporting data such as links clicked etc is then stored in an online db somewhere. The url of the redirect link is as follows:
    http://61.151.248.10/redirect.asp?e=xxx@hotmail.com

    The variable e holds the data that I need. Can anyone tell me please how I can extract that variable to even just show on the actual resulting url that I want the user to go to?

    The current flow is below, hope this makes sense.

    Customer Email - - - - - > Redirect URL which has "e" variable - - - - >My Page

    Any help with this would be much appreciated, I really am struggling with this and I'm not even sure if its possible but hoping someone can point me in the right direction.

    Thanks for any help in advance.

  2. #2
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,629
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Do you have access to the redirect.asp file?

    If yes, you can get the e=xxx@hotmail.com part by using:
    Code ASP:
    QS = Request.ServerVariables("QUERY_STRING")
    ' Thus QS = "e=xxx@hotmail.com"
    Extract the email address part as follows:
    Code ASP:
    sEmail = "" 'Set a default empty string
    If Instr (QS, "=") > 0 Then 'We have a value, and it contains =
      aQS = Split (QS, "=") 'Make an array (0)="e"; (1)="xxx@hotmail.com"
      If Ubound (aQS) = 1 Then 'Check the array has only 2 elements
        sEmail = aQS(1)
        'Check there were no other QS parameters after the email
        If Instr (sEmail, "&") > 0 Then sEmail = Left (sEmail, Instr (sEmail, "&")-1)
      End If
    End If
     
    If len (sEmail) > 0 Then 'The above code did give us an email address
      ' Do whatever you need to do
    End If
    Ian Anderson
    www.siteguru.co.uk

  3. #3
    SitePoint Guru
    Join Date
    Jun 2007
    Posts
    689
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if the file redirect.asp is accessible and you want the email address you can retrieve it by:

    email_address = request.querystring("e")

  4. #4
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,629
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    DOH!
    Ian Anderson
    www.siteguru.co.uk

  5. #5
    SitePoint Addict
    Join Date
    Dec 2005
    Posts
    381
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the replies, problem is I have no access to the redirect.asp file. I'm guessin its part of this software that sits on a server somewhere. Does that mean there's no way for me to do this?

  6. #6
    SitePoint Guru
    Join Date
    Jun 2007
    Posts
    689
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    correct.

    There's no way to capture url's going to another server website unless you have access to the website.

    So you will need to better explain what exactly you are trying to accomplish.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •