SitePoint Sponsor

User Tag List

Results 1 to 22 of 22

Thread: Create ASP for referral ID

  1. #1
    SitePoint Zealot
    Join Date
    Jun 2001
    Location
    Jakarta
    Posts
    156
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Create ASP for referral ID

    Can someone help me. I want to try make referral id. Is it in every page I should always receive the referral id and post it again ? Or I just create a cookies ? Or maybe there is another way. Can someone explain to me ? Thanks

  2. #2
    Say WHA?! goober's Avatar
    Join Date
    Sep 2000
    Location
    United States
    Posts
    1,921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Explain to us exactly what you're trying to accomplish (i.e "i have a list of products, and I need to pass the product ID to the next page when a link is clicked on") etc., or something like that.

    Ultimately, you're going to learn QueryStrings in this post. How to send them, how to get them. How much do you know about querystrings before-hand?
    Sean Killeen [LinkedIn] [Twitter] [Web]

    Warning: Reality.sys corrupted. Universe halted. Reboot? (Y/N)

  3. #3
    32,817 silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This one sounds like fun, I'm in for this lesson, I might learn something (yes, I know querystrings, but I'm not sure I KNOW them )
    Digital Hitman, netmobs
    Personal blog: Ensight
    Twitter: @jeremywright

  4. #4
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    whoohoo querystrings

    uhm...yeah...

  5. #5
    Say WHA?! goober's Avatar
    Join Date
    Sep 2000
    Location
    United States
    Posts
    1,921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, jet, what are you trying to do in your site? Give us a little description. Are you linking products or articles or something like that?

    edited due to stupidity.
    Last edited by goober; Aug 20, 2001 at 11:35.
    Sean Killeen [LinkedIn] [Twitter] [Web]

    Warning: Reality.sys corrupted. Universe halted. Reboot? (Y/N)

  6. #6
    Say WHA?! goober's Avatar
    Join Date
    Sep 2000
    Location
    United States
    Posts
    1,921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've taken care of it.
    Sean Killeen [LinkedIn] [Twitter] [Web]

    Warning: Reality.sys corrupted. Universe halted. Reboot? (Y/N)

  7. #7
    SitePoint Zealot
    Join Date
    Jun 2001
    Location
    Jakarta
    Posts
    156
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for replying.

    I want to make a homepage to sell my product. Just like Amazon.com, people register to affiliate. After that they put a banner or link in their homepage with their affiliate number (example: http://www.myhomepage.com?affiliateid=a11001). So when people interest, it'll take to my homepage.
    And what I want to ask is what is the best way to keep the 'affiliateid'. So when people browsing through my homepage (not register yet), I still can find out where they came from. And when they register, the 'affiliateid' is recorded.

    I know about querystring. But I'm wondering what is the convenient way to do that.
    I was thinking to create the 'affiliateid' to cookies. So when they register, I just get the cookies.
    Is there any better way ? Thanks for comments and suggestions.

  8. #8
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the easiest way to do it would enter the affliateid as a sessiob objejct, and then they registed, record it into a db

  9. #9
    Say WHA?! goober's Avatar
    Join Date
    Sep 2000
    Location
    United States
    Posts
    1,921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    (edited due to a slight misunderstanding)

    Well, you obviously have your users database if you're having people sign up. I would suggest, in the orders table, including an optional "affiliateid" field.

    If you know about global.asa, then what you do is go into global.asa and insert this code into the Sub Session_onStart area:
    Code:
    If NOT Request.QueryString("affiliateid") = "" then
    Session("affiliateid") = Request.QueryString("affiliateid")
    End If
    This will save the affiliate ID for as long as a person has your site open (a.k.a they have an 'open session' with your site). Then, when someone registers, Check to see if the session value exists. If it does, add it into that 'affiliateid' field in your sales table.

    If you've any questions, just let me know.

    Hope this helped.
    Last edited by goober; Aug 21, 2001 at 06:23.
    Sean Killeen [LinkedIn] [Twitter] [Web]

    Warning: Reality.sys corrupted. Universe halted. Reboot? (Y/N)

  10. #10
    SitePoint Zealot
    Join Date
    Jun 2001
    Location
    Jakarta
    Posts
    156
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you explain more about this or where I can find the reference. I don't know much about sesssion. And what's the benefit using session ?

  11. #11
    SitePoint Zealot
    Join Date
    Jun 2001
    Location
    Jakarta
    Posts
    156
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I forget something...
    I use web hosting service and I don't think they will let me to modify the global.asa

  12. #12
    Say WHA?! goober's Avatar
    Join Date
    Sep 2000
    Location
    United States
    Posts
    1,921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Session variables require less scripting to access than cookies. I don't have to go through the process of getting cookie values, I can simply say something like
    Code:
    <% Response.Write Session("affiliateid") %>
    Some handy articles on Sessions can be found here:I hope this helps a little bit. If not, Someone else has to have some links on Session variables that they can lend to you.

    Good luck. If you can't find any articles, I'll show you how to use them, though I'm not the best. They should also be used sparingly (i.e don't use 20 of them, it will slow down your performance. 1 or 2 is alright).

    'Till next time..
    Sean Killeen [LinkedIn] [Twitter] [Web]

    Warning: Reality.sys corrupted. Universe halted. Reboot? (Y/N)

  13. #13
    Say WHA?! goober's Avatar
    Join Date
    Sep 2000
    Location
    United States
    Posts
    1,921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, jet, they SHOULD let you edit global.asa. It's included with every one of your web applications. It's just a text file. I can copy you a blank one if you'd like to paste in your home directory.

    If they don't let you edit it, there's something fishy there. If you can't use session variables, you'll have to use cookies. And that's no fun, so much extra work.
    Sean Killeen [LinkedIn] [Twitter] [Web]

    Warning: Reality.sys corrupted. Universe halted. Reboot? (Y/N)

  14. #14
    SitePoint Zealot
    Join Date
    Jun 2001
    Location
    Jakarta
    Posts
    156
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot for your help.
    I'll try to read the articles first and ask to my webhosting provider how to use the global.asa.

  15. #15
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    but cookies are fun... spcially the chocolate chip kind

    jet, who is ur host?

    amd if you need help with cookies, dont hesitate to ask

  16. #16
    SitePoint Guru
    Join Date
    Dec 2000
    Location
    Karachi, Pakistan
    Posts
    913
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would recommend using Cookies.. This way you would not only increase the number of affiliates..

    This is the same method as CJ have..


    [method]
    When a visitor clicks your affiliates banner, he visits your website. and a cookie is set on the visitors compputer.. and is valid for the next one month...
    after one month the cookie expires..

    In the order table and the member ship table there should be an additional field known as affiliate.. in which the affiliates field would ke inserted if any..

    [/method]


    Any comments on the method ??
    36Host.com - $36/year web hosting [affiliates earn 30%]
    * Affordable Small Business Web Hosting since 2003! *
    "500mb space, 10gb bandwith, 50 pop/ftp accounts, php,
    mysql, pre-installed php scripts, 24/7 support & more...."



  17. #17
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah, user has cookies turned off

    cookies are good for remembering people, and saving time to log in etc. but as for retaining information that has to be taken over pages it isnt the safest way. if you cant do it thru session objects, you best with thr querystring

  18. #18
    SitePoint Guru
    Join Date
    Dec 2000
    Location
    Karachi, Pakistan
    Posts
    913
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is always an alternate way...

    you can always put up a note that Cookies have to be enabled in order to track affiliates..

    or you can always use the querystrings method..

    either one would work...

    it all depends on you...

    ' Happy Coding
    36Host.com - $36/year web hosting [affiliates earn 30%]
    * Affordable Small Business Web Hosting since 2003! *
    "500mb space, 10gb bandwith, 50 pop/ftp accounts, php,
    mysql, pre-installed php scripts, 24/7 support & more...."



  19. #19
    SitePoint Zealot
    Join Date
    Jun 2001
    Location
    Jakarta
    Posts
    156
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I assume everybody enabled to receive cookies. But if the visitors already sign, then automatically the cookies will be delete. So when the next time they visite my homepage again. The affiliateid will no longer stay (either they sign or not sign). But this is still my theory.

    About querystring, that mean in every page in my site I have to put the request.querystring("affiliateid") and <input type=hidden name="affiliateid" value="request.querystring("affiliateid")">
    Is that right ?
    As the discussion before, it seem session is the best way to do this job.

  20. #20
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    About querystring, that mean in every page in my site I have to put the request.querystring("affiliateid") and <input type=hidden name="affiliateid" value="request.querystring("affiliateid")">
    Is that right ?
    not really, jus make each link look like

    Code:
    <a href="blah.asp<%if len(request.querystring("affiliateid")) > 1 then response.write("?" & request.querystring("affiliateid"))%>">Blah</a>

  21. #21
    SitePoint Zealot
    Join Date
    Jun 2001
    Location
    Jakarta
    Posts
    156
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is that mean that I have put the
    <%if len(request.querystring("affiliateid")) > 1 then response.write("?" & request.querystring("affiliateid"))%>

    after every links ?

  22. #22
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    uhm... yeah... so sessions is the easiest way

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
  •