Results 1 to 2 of 2

 

Thread: Passing Keyword Data Thru php Redirect Links?

  1. #1
    KirstyM's Avatar
    Super Moderator

    Status
    Offline
    Join Date
    Nov 2004
    Location
    On World Tour!
    Posts
    1,382
    Thanks
    57
    Thanked 49 Times in 38 Posts


    Hello,

    I've been curious about this one for a while. I used to used a php echo on my PPC landing pages to pass keyword data from the URL into the clickreference field of an affiliate link.

    However, now that a lot of people are using php links to mask their affiliate urls I was wondering how you could still record keyword data by passing variables through your masked urls? I'm assuming this is relatively straightforward if you've a knowledge of php!
    Please Read My Affiliate Marketing Blog. & consider joining The Affiliate Lending Team - help entrepreneurs in 3rd world countries - all the cool affiliates are doing it

  2. #2
    futureweb's Avatar
    Registered User

    Status
    Offline
    Join Date
    Jul 2005
    Location
    North Devon
    Posts
    919
    Thanks
    13
    Thanked 22 Times in 22 Posts
    PHP Code:
    // Session to store your keyword
    session_start();
    session_register('keyword');

    if(
    preg_match('/google|yahoo|msn|altavista/i'$parts['host']) && !empty($parts['query'])) {
    }
    $referer_query '';


    $referer_params = array('q','query','p','Q','Query','P');

    if(!empty(
    $_SERVER['HTTP_REFERER'])) {
       
    $parts parse_url($_SERVER['HTTP_REFERER']);
       if(!empty(
    $parts['query'])) {
           
    parse_str($parts['query'], $query_params);
           foreach(
    $referer_params as $key) {
              if(isset(
    $query_params[$key])) {
                  
    $referer_query $query_params[$key];
                  break;
              }
           }
       }
    }


    if(!empty(
    $referer_query)) {
    $_SESSION['keyword'] = urlencode($referer_query);
    }else{
    // theres no keyword Bookmark?
    $_SESSION['keyword'] = 'NULL';

    You can then carry this over to your links page and call the session var

    PHP Code:
    // Links page

    // Don't forget this
    session_start();

    // link example
     
    $link mysql_query("select link from tablename where id = '".$_GET['id']."'");
        
    $l=mysql_fetch_assoc($link);
    header('Location: '.$link.'&epi='.$_SESSION['keyword']);
    exit(); 



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. The Good Feed Guide (For Merchants)
    By clint45 in forum Programming
    Replies: 18
    Last Post: 07-01-09, 10:54 PM
  2. php scripts to display data from MySql
    By accelerator in forum Programming
    Replies: 3
    Last Post: 03-01-06, 02:26 AM
  3. mysql / php / insert data into many tables
    By morleymouse in forum Programming
    Replies: 9
    Last Post: 05-01-05, 03:46 PM
  4. data feeds with php
    By Peter Skellen in forum Programming
    Replies: 1
    Last Post: 09-10-03, 08:45 PM

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
  •  
To Top

Content Relevant URLs by vBSEO 3.5.0 RC2