removing the querystring

Results 1 to 2 of 2

Thread: removing the querystring

  1. #1
    Join Date
    Dec 1969

    Default removing the querystring

    I have a script for an affiliate program that saves the name of the refering page that sends each visitor to a couple of my sites. the script works fine until i sign up each of my sites for each other&#039;s affiliate programs and 1.) try to click a link from one of my sites to the other and then 2.) try to click back to the first site through the banner ad on the second site. i can make the first link fine, but the return link causes an error message <BR><BR>i think the problem is that my affiliate script uses Request.QueryString to populate variables, and the script does not know what to do when the url of the referring page and the url from the hyperlink both contain querystrings that use the same variable names with different values for the same variables.<BR><BR>for example, the variable referer might be joe on one url and sam on the other url. the script doesnt know whether to use joe or sam as the value<BR><BR>i want to solve this problem by removing the querystring from the url i get for the referring page. that way only the hyperlink url will have a querystring. can someone show me how to do this in vbscript?<BR><BR>the english language version of what i want to do is:<BR>----------------------------------------------------------------<BR>Dim referrer<BR> referrer = Request.ServerVariables( "HTTP_REFERER" )<BR> If referrer contains ? Then<BR> remove all text to the right of (and including) "?" in<BR> the querystring<BR> End If<BR>-----------------------------------------------------------------<BR>can anyone show me how to do alter the above code so that it actually does what i want it to in vbscript?<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: removing the querystring

    Dim referrer<BR>referrer = Request.ServerVariables( "HTTP_REFERER" )<BR>qAt = InStr(referrer,"?")<BR>If qAt &#062; 0 Then referrer = Left( referrer, qAt-1 )<BR>

Posting Permissions

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