I have a 2 problems, I need to track referrer urls with a: 

 

PROBLEM #1
With HTML Extension
http://www.anydomain.com/main.htmll?
<http://www.anydomain.com/main.htmll?Aid=44554> Aid=44554 

 

1.         From an html page I used a similar url
http://www.anydomain.com/main.html?
<http://www.anydomain.com/main.html?Aid=44554> Aid=44554 

All the information comes back with the exception of the variables

ie: Aid=44554 I have tried every global, get, env, server, post request
and nothing.

 

 

Nothing separates the variables from the url

What I am getting for problem 1 is:

id  affiliate_id     site                                request_time  
1   0                'www.anydomain.com'         '2002-08-01 08:02:37'


What I need for problem 1 is:

id  affiliate_id     site                                request_time  
1   44554          'www.anydomain.com'       '2002-08-01 08:02:37'

this is the dump for the tracker table from the page with the HTML
extension


INSERT INTO tracker VALUES (1, 0, 'www.anydomain.com', '2002-08-01
08:02:37', '74fcfc275d5c481c4ce77c9225333f78',
'http://www.anydomain.com/main.html?Aid=44554', '/affiliate/_track.php',
'', 'GET', '/affiliate/_track.php', '65.100.198.85',
'slkcdslgw7PoolA85.slkc.uswest.net', 'MS Internet Explorer', '6.0',
'Windows', '2000', '*/*', 'en-us', 'Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1; Q312461; .NET CLR 1.0.3705)', 8);


PROBLEM #2
With PHP Extension
http://www.anydomain.com/main.php?
<http://www.anydomain.com/main.php?Aid=88778> Aid=88778

 

2.         If I use this from a php page ie:
http://www.anydomain.com/main.php?
<http://www.anydomain.com/main.php?Aid=88778> Aid=88778 not only does
the variables not show up but the referrer and host and other info does
not pass.



This is the same page and same internet connection, but using PHP as an
extension instead of HTML, you'll notice that much of the information is
unknown.

this is the dump for the tracker table from the page with the PHP
extension


INSERT INTO tracker VALUES (2, 0, 'www.anydomain.com', '2002-08-01
08:04:12', '5b7f77e273ccf01d1a1d0f87713d5ecb', '',
'/affiliate/_track.php', '', 'GET', '/affiliate/_track.php',
'209.197.255.10', 'Unresolved Address', 'Unknown', 'Unknown', 'Unknown',
'Unknown', '', '', 'PHP/4.2.2', 0);


Is there any other suggestions for both problems.

Here is the section of code I am currently using:

 

 

    function record($DEBUG=0,$useragent=''){

        global $_SERVER, $HTTP_SESSION_VARS;

 
preg_match('/.*\?Aid=([0-9]+)/',$REQUEST_URI,$matches);

                        $Aid=$matches[1]; 

        if($DEBUG){

            echo "Recording...<br>\n";

            flush();

        }

 

        $REMOTE_ADDR='';

        $HTTP_ACCEPT='';

        $HTTP_ACCEPT_LANGUAGE='';

        $REQUEST_METHOD='';

        $SCRIPT_NAME='';

        $QUERY_STRING='';

        $REQUEST_URI='';

        $HTTP_REFERER='';

        $RDATE_TIME             = date("Y-m-d H:i:s");

       

        // below is to prevent servers like IIS from throwing errors
when a

        // server var doesn't exist (like REQUEST_URI)

        if(isset($_SERVER['REMOTE_ADDR']))

            $REMOTE_ADDR = $_SERVER['REMOTE_ADDR'];

        if(isset($_SERVER['HTTP_ACCEPT']))

            $HTTP_ACCEPT = $_SERVER['HTTP_ACCEPT'];

        if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))

            $HTTP_ACCEPT_LANGUAGE = $_SERVER['HTTP_ACCEPT_LANGUAGE'];

        if(isset($_SERVER['REQUEST_METHOD']))

            $REQUEST_METHOD = $_SERVER['REQUEST_METHOD'];

        if(isset($_SERVER['SCRIPT_NAME']))

            $SCRIPT_NAME = $_SERVER['SCRIPT_NAME'];

        if(isset($_SERVER['QUERY_STRING']))

            $QUERY_STRING = $_SERVER['QUERY_STRING'];

        if(isset($_SERVER['REQUEST_URI']))

            $REQUEST_URI = $_SERVER['REQUEST_URI'];

        if(isset($_SERVER['HTTP_REFERER']))

            $HTTP_REFERER = $_SERVER['HTTP_REFERER'];

 

        $REMOTE_HOST = gethostbyaddr($REMOTE_ADDR);

        if($REMOTE_HOST == $REMOTE_ADDR)

            $REMOTE_HOST = "Unresolved Address";

 

                        if(isset($_GET['Aid']))

                        $Aid=$_GET['Aid'];

                        else if(isset($_POST['Aid']))

                        $Aid=$_POST['Aid'];

                        else

                        $Aid=-100;  // For debug

 

        if(empty($useragent))

            $HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];

        else

            $HTTP_USER_AGENT = $useragent;    // for debugging
browser/op sys regex

 

        $browser=$this->getBrowser($HTTP_USER_AGENT);   // get the
browser info

//echo "<pre>\n".$HTTP_USER_AGENT; print_r($browser); echo "\n";

        $system=$this->systemInfo($HTTP_USER_AGENT);    // get the
system info

//echo "<pre>";print_r($system); echo "</pre>";

        $query="insert into ".$this->STAT_TABLE."(site, affiliate_id,
request_time, session_id, referer, request_uri, ".

            "query_string, request_method, script_name, remote_addr,
remote_host, browser, browser_version, platform, os, ".

            "accept, accept_language, user_agent, page_num) values('";

 
$this->Q_NFO=$this->STAT_SITE."','".$Aid."','".$RDATE_TIME."','".session
_id()."','".

 
$HTTP_REFERER."','".$REQUEST_URI."','".$QUERY_STRING."','".$REQUEST_METH
OD."','".$SCRIPT_NAME."','".

 
$REMOTE_ADDR."','".$REMOTE_HOST."','".$browser['browser']."','".$browser
['version']."','".$system['platform'].

 
"','".$system['os']."','".$HTTP_ACCEPT."','".$HTTP_ACCEPT_LANGUAGE."','"
.$HTTP_USER_AGENT;

        $query.=$this->Q_NFO."','".$_SESSION['page_num']."')";

 

        if($DEBUG){

            echo "Recording Ended.<br>\n";

            echo
str_replace("'","",str_replace("','","<br>",$this->Q_NFO));

            flush();

        }else

            $this->Insert($query);

    }

 

 

 

I use:


HTTP Server:

Apache/1.3.26 (Unix) mod_gzip/1.3.19.1a PHP/4.2.2 mod_log_bytes/0.3
FrontPage/5.0.2.2510 mod_ssl/2.8.9 OpenSSL/0.9.6d mod_bwlimited/1.0


PHP Version:

4.2.2 (Zend: 1.2.0)

 

 

Thanks,

DN Jacobsen

Reply via email to