Page 2 of 2 FirstFirst 12
Results 16 to 26 of 26

Thread: AXS Visitor Tracking PHP Module

  1. #16
    Junior Registered
    Join Date
    Aug 2005
    Posts
    9
    Oops, my fault. When adding that to the page, I accidentally stripped out a </script> tag. Fixed that, and now what I get is the include in text at the top of the page.

    Any ideas?

  2. #17
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    What is appearing exactly?
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  3. #18
    Junior Registered
    Join Date
    Aug 2005
    Posts
    9
    Quote Originally Posted by Chris
    What is appearing exactly?
    include("/your/path/to/file/axs.php")

    at the top of the page in just plain text (but with the correct path filled in)

    It's like the page is just reading it as text instead of some kind of include. I did make a file with the code at the top of this thread and called it axs.php

  4. #19
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    Well I don't know how IPB works on the backend, but with vbulletin I just copy the contents of the file and paste it directly into the php_include_start field of the admin template editor.

    I assume that your include statements has <? ?> around it?
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  5. #20
    Chronic Entrepreneur
    Join Date
    Nov 2003
    Location
    Tulsa, Oklahoma, USA
    Posts
    1,112
    I'm guessing it's as Chris says, you forgot to enclose the statement in <? ... ?> .

    Also remember to put a semicolon at the end of the include statement. The whole thing would look like this:

    <?
    include("/your/path/to/file/axs.php");
    ?>

    And of course, you'll need to change "/your/path/to/file/axs.php" to the correct path to the file on your server.

  6. #21
    Junior Registered
    Join Date
    Aug 2005
    Posts
    9
    Quote Originally Posted by Westech
    I'm guessing it's as Chris says, you forgot to enclose the statement in <? ... ?> .

    Also remember to put a semicolon at the end of the include statement. The whole thing would look like this:

    <?
    include("/your/path/to/file/axs.php");
    ?>

    And of course, you'll need to change "/your/path/to/file/axs.php" to the correct path to the file on your server.
    I think you and Chris are guessing right. I'm a copy and paste PHP wizard, but I did wonder about that (since I've copied and pasted so much PHP) and tried adding <?path/axs.php but I closed it with a simple >.

    I'll go try your code, and thank you!

  7. #22
    Junior Registered
    Join Date
    Aug 2005
    Posts
    9
    Well, the good news is that putting in the correct code worked in that it no longer appears as a line of text.

    The bad news is that it's not logging anything. I did switch my axs to log my visits and nothing. I changed the code back to the javascript and it started logging again.

    I've double checked my paths. I had put the new axs.php file into the root directory. Should it go into the axs folder in the cgi-bin? I also tried chmodding the file to 777 (default was 644).

  8. #23
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    axs.php doesn't need to be 777, it isn't writing to itself.

    make sure the log file patch is correct. If you put the axs.php file in the same directory has the log file you shouldn't (i think) have to include the full path, just "log.txt", so try that.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  9. #24
    Junior Registered
    Join Date
    Jun 2009
    Posts
    2
    Quote Originally Posted by GCT13 View Post
    The AXS visitor tracking software has been highly recommended by Chris and others on this forum. It comes with a default javascript module code you place on each page of your site.

    Below you will find Chris' PHP module code for AXS. Among its advantages over the javascript is the ability to track search engine spiders as they crawl your site. I find this to be a huge benefit. Note that you do loose the ability to not log your visits using this technique. Chris agreed it could be posted in the forum so here it is... enjoy:

    PHP Code:
    if ($_COOKIE['axs_no_log'] != "1") {
    $AXSLogFile '/full/path/to/log.txt';
    $AXSTimeOffsetInHours = +1;

    $AXSdomain 'http://www.yourdomain.com';
    $AXSuri $_SERVER['REQUEST_URI'];
    $AXSrad $_SERVER['REMOTE_ADDR'];
    $AXSREMOTE_HOST = @getHostByAddr($AXSrad);
    $AXSFrom $_SERVER['HTTP_REFERER'];
    $AXSTo $AXSdomain.$AXSuri;
    $AXSHTTP_USER_AGENT $_SERVER['HTTP_USER_AGENT'];

    $AXSunixtime time() + (3600*$AXSTimeOffsetInHours);
    $AXSsecond date("s", ($AXSunixtime))+0;
    $AXSminute date("i", ($AXSunixtime))+0;
    $AXShour date("G", ($AXSunixtime))+0;
    $AXSday date("j", ($AXSunixtime))+0;
    $AXSmonth date("n", ($AXSunixtime))-1;
    $AXSyear date("y", ($AXSunixtime))+100;
    $AXSwday date("w", ($AXSunixtime))+0;
    $AXSyday date("z", ($AXSunixtime))+0;

    $AXSlogline =
    "|$AXSREMOTE_HOST|$AXSrad|$AXSFrom|$AXSTo|$AXSHTTP_USER_AGENT|$AXSsecond|$AXSminute|$AXShour|$AXSday|$AXSmonth|$AXSyear|$AXSwday|$AXSyday|\n";

    $AXSfile fopen("$AXSLogFile""a");
    flock($AXSfile2);
    fwrite($AXSfile"$AXSlogline");
    flock($AXSfile3);
    fclose($AXSfile);

    *** Be sure to make the $AXSlogline = "...."; one line, and no space between the quote and the '|', I don't know why vb is doing that.

    Reference:

    http://www.websitepublisher.net/foru...=&threadid=392
    http://www.xav.com/scripts/axs/
    Hi Guys

    I am using this php module with axs, to log
    php forum hits, it seems bots are causing this error

    8: Undefined index: HTTP_REFERER
    Line ==>11: $AXSFrom = $_SERVER['HTTP_REFERER'];

    also this error as well

    8: Undefined index: axs_no_log
    Line ==>3: if ($_COOKIE['axs_no_log'] != "1") {

    is there something I can do to correct this?
    I am using the exact code above
    I didn't change anything.

    Thanks
    Sonny D
    Last edited by Sonnyd; 06-20-2009 at 09:49 PM.

  10. #25
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    Try removing making the first variable $HTTP_REFERER instead. I doubt that'll work, but try.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  11. #26
    Junior Registered
    Join Date
    Jun 2009
    Posts
    2
    Problem Fixed

    Changed first line to
    if (isset($_COOKIE['axs_no_log']) && $_COOKIE['axs_no_log'] != "1") {


    Replaced the following
    Code:
    $AXSHTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
    $AXSFrom = $_SERVER['HTTP_REFERER'];

    With the following
    Code:
    if (isset($_SERVER['HTTP_REFERER'])) {
        $AXSFrom = $_SERVER['HTTP_REFERER']; 
    } else {
       $AXSFrom = "User Agent did not provide this value";
    }
    Hope this helps someone

    SonnyD

Similar Threads

  1. Review: Professional PHP Programming
    By Chris in forum Books
    Replies: 6
    Last Post: 07-17-2013, 05:26 AM
  2. Learning how to create PHP database driven sites online...
    By incka in forum Website Programming & Databases
    Replies: 15
    Last Post: 01-23-2004, 03:18 PM
  3. How do I make my PHP thing list in name order?
    By incka in forum Website Programming & Databases
    Replies: 8
    Last Post: 12-11-2003, 07:18 AM
  4. PHP, ODBC, and Unicode compatibilities...
    By Stevens in forum Website Programming & Databases
    Replies: 4
    Last Post: 10-14-2003, 09:27 AM
  5. PHP Include
    By Mike in forum Website Programming & Databases
    Replies: 4
    Last Post: 05-29-2003, 08:19 AM

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
  •