1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

use affiliate code in URL in php

Discussion in 'PHP' started by bartlomiej, Apr 5, 2005.

  1. #1
    I am a newbie at php, and i need some help.

    I am trying to use the affiliate id in the url and then use it in the php code
    for example:
    URL: www.xyz.com?id=123
    SEMrush
    I want to use the id=123 within the php code for choosing the appropriate page or using related information stored away in an excel/csv file.

    can anyone please let me know how to do this or send me to a site that explains this? thanks!
     
    bartlomiej, Apr 5, 2005 IP
    SEMrush
  2. nullbit

    nullbit Peon

    Messages:
    489
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You need to clarify more, such as what the condition is for determining the correct affiliate id, and also posting the proposed format of your CSV file would be helpful.

    Secondly, you would be better to store any such information in a database, instead of a CSV file.
     
    nullbit, Apr 5, 2005 IP
  3. bartlomiej

    bartlomiej Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i want to use the id in the url and use it in the php script, for instance, with a switch statement to generate some specific information on the page based on the id in the url.
     
    bartlomiej, Apr 5, 2005 IP
  4. nullbit

    nullbit Peon

    Messages:
    489
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I think what you are asking, but I'm still not sure, is how to extract the id field from the current URL? If yes, then the variable you need is $_GET['id']
     
    nullbit, Apr 5, 2005 IP
  5. bartlomiej

    bartlomiej Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    sweet! thanks!
     
    bartlomiej, Apr 5, 2005 IP
  6. Cartman

    Cartman Active Member

    Messages:
    354
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    88
    #6
    Sorry to bump an old thread, but this is what I've been trying to do, but I'm not a PHP expert by any means.. I too am trying to pass a numeric in the same way:

    URL: www.xyz.com/test.html?id=123

    From the sounds of it, I'm using the $_GET['id'] to parse the value passed in the URL. What is the code to do this in an HTML file, and then use that variable in my code (I'm trying to launch a specific IFrame dependant on the id passed.

    Thanks.
     
    Cartman, Jun 8, 2005 IP
  7. sadcox66

    sadcox66 Spirit Walker

    Messages:
    496
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I think you should use something like .php if you want to extract id=123 easily. That does not mean you cannot add parameters to .html files - you can if your familiar with mod-write, addtype and other options.


    This tutorial may give you more information
     
    sadcox66, Jun 9, 2005 IP