Newbie Question: How to pass a seed variable from index page to inner page

Discussion in 'PHP' started by buckknife1, Aug 9, 2009.

  1. #1
    I have an affiliate site and need to better track my ad campaign on PPC. I'm sending traffic to a php page which passes the keyword as a seed variable. Then I've been putting making the sid for all of my links retreive the keyword from the url. I lose a lot of information though because if they click to a second page to get a better review, I lose the seed variable and the sid in the affiliate links is blank.

    How can I fix this?
     
    buckknife1, Aug 9, 2009 IP
  2. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Well, you'd just put it in a cookie or in the session.
     
    premiumscripts, Aug 10, 2009 IP
  3. astrazone

    astrazone Member

    Messages:
    358
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    33
    #3
    well you need to store that info somewhere... cookie,file or any other way that is working for you.
     
    astrazone, Aug 10, 2009 IP
  4. regster

    regster Guest

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    As said earlier, cookies/sessions are a very good and simple solution!
     
    regster, Aug 10, 2009 IP
  5. buckknife1

    buckknife1 Peon

    Messages:
    335
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thanks. does anyone have information on how to accomplish this?
     
    buckknife1, Aug 18, 2009 IP
  6. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Just do this on the first page:

    
    session_start();
    
    $_SESSION['seed'] = $_GET['keyword']; //or whatever
    
    PHP:
    Second page:

    
    session_start();
    
    echo $_SESSION['seed']; //if you need to output it again
    
    PHP:
     
    premiumscripts, Aug 18, 2009 IP
  7. buckknife1

    buckknife1 Peon

    Messages:
    335
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    thanks for the help!
     
    buckknife1, Sep 6, 2009 IP