Announcement

Collapse
No announcement yet.

How to log the IP address when an order is placed

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Originally posted by berniejones
    Folks,
    An update on the IP address logger:

    Many ISPs use proxies to forward the requests from their clients onto the 'net.

    In these cases, the REMOTE_HOST and REMOTE_ADDR values relate to the ISP's proxy server and not to the end client (the PC/Mac/whatever) that you're interested in capturing.

    I've noticed for instance that nearly half my hits are from NTL proxies.

    These proxies can (and should) carry through the address of the actual client in one of two other HTTP header variables: HTTP_CLIENT_IP or HTTP_X_FORWARDED_FOR.

    So, a better check is to first determine whether either of these values is non-null and, if so, to use that value. If they are null, then the exising code is good. Alternatively you may just capture these value in addition to the existing ones and log them all.

    A final point: Many ISPs allocate dynamic IP addresses from a 'pool' that they are allocated. This is typically used for dial up connections and means that:

    a) The same physical user and PC may have a different IP address each time they connect
    b) The same IP address does not necessarily mean the same physical user!

    Oh the joys of identity management through HTTP!!

    Hope that helps,

    Bernie
    Anyone managed to get this part of this script working yet? Had a few fraudulent transactions over the last few weeks and whilst we have caught all of them we would like to log as much info as possible!

    Dave
    Cheers

    David
    Located in Edinburgh UK

    http://twitter.com/mcfinster

    Comment


      #17
      Hi All

      I have read this thread with interest as it is exactly what I need to do, however I have a problem which Actinic Tech Support could not help me with.

      If you have referral codes setup for tracking referrals from google, yahoo etc. this uses 'User Definable 3' and is populated with the value 'Referrer' which stores the code that is sent with the referral URL.

      Any ideas how I can continue to use the referral codes and still capture the IP address.

      It's worth saying that we already use 'User Definable 1' and 'User Definable 2' for other marketing information?

      Any help would be appreciated?

      Comment


        #18
        Hi Darren

        As i understand it, you'd have to use one of the existing 3 user definables. This obviously rules out #3 in your case. I think that more cannot be added, although there may be an extension that adds futher user definables?

        We were in a similar boat - we had to sacrifice an existing marketing definable field in order to implement IP logging.


        Ryan

        Comment


          #19
          I have followed all the instructions above to add the IP logging. All works fine on the misc tab when the order is retrieved.

          However, i cannot get it to work in the customer email. I downloaded the advanced guide, and followed that to the letter, but still it does not work.

          When i receive the email, it still displays the "<Actinic:GETUSERDEF/>" instead of the actual data.

          Can anybody help please

          Dave.
          www.xcelcius.com
          Thermal Underwear thats gives protection down to -25c

          Comment


            #20
            Hi Dave,

            It should be "<Actinic:GENUSERDEF/>" not "<Actinic:GETUSERDEF/>". Replace that and it should work.

            Kind Regards
            Nadeem Rasool
            SellerDeck Development

            Comment


              #21
              Hi All

              just remembered, doing a lot of spring cleaning lately, did anyone get this to work on there reciept page and the customer email.

              I have never managed to achieve this although the IP address is recorded in the misc tab of an order.

              also did anyone manage to work this out
              Have you written code to include the HTTP_CLIENT_IP or HTTP_X_FORWARDED_FOR variables. I have tried to amend yours but sadly my script amending leaves a lot to be desired!
              cheers
              Darren

              Comment


                #22
                Darren,

                Afraid that has not been worked out as yet. It is an item for the wishlist, I will add a vote for you.

                Kind regards,
                Bruce King
                SellerDeck

                Comment


                  #23
                  Originally posted by dave_finlayson
                  Have you written code to include the HTTP_CLIENT_IP or HTTP_X_FORWARDED_FOR variables. I have tried to amend yours but sadly my script amending leaves a lot to be desired!
                  Having just discovered this thread I have amended my script as follows -

                  Code:
                  my $remote_host = $ENV{'REMOTE_HOST'}; 
                  my $remote_addr = $ENV{'REMOTE_ADDR'}; 
                  my $remote_client = $ENV{'HTTP_CLIENT_IP'}; 
                  my $remote_httpx = $ENV{'HTTP_X_FORWARDED_FOR'}; 
                  
                  if (($remote_host eq $remote_addr) || ($remote_host eq '')) {
                  $remote_host = gethostbyaddr(pack('C4', split(/\./, $remote_addr)), 2) || $remote_addr;
                  }
                  $::s_VariableTable{$::VARPREFIX.'GENERALUSERDEFINED'} = $remote_addr . '  ' . $remote_host . '  ' . $remote_client . '  ' . $remote_httpx;
                  Theoretically this should combine all 4 fields, and because some will be blank I've used spaces as separators so it's not obvious to the user that it didn't get all the info. I've been unable to test this properly as I'm using my test server on the same network so HTTP_CLIENT_IP and HTTP_X_FORWARDED_FOR are both blank - perhaps someone could test this?

                  The captured info can easily be displayed in the checkout using the following in order02, after the hidden bit -

                  Code:
                  <B>Your PC info has been logged for security Purposes : </B>NETQUOTEVAR:GENERALUSERDEFINED
                  John

                  Comment


                    #24
                    Is it just me being dense or has OrderScript.pl changed in v8.5.1 rendering this script change impossible?

                    I have implmented it on every update from v7 and all of a sudden the code seems to have completely changed!
                    Cheers

                    David
                    Located in Edinburgh UK

                    http://twitter.com/mcfinster

                    Comment


                      #25
                      Dave,

                      I am looking this up for you.

                      Kind regards,
                      Bruce King
                      SellerDeck

                      Comment


                        #26
                        Thanks Bruce
                        Cheers

                        David
                        Located in Edinburgh UK

                        http://twitter.com/mcfinster

                        Comment


                          #27
                          Hi David,

                          v8.5.1 has some changes to the scripts to accommodate new features. One of the changes was to move the sub routine you are looking for from OrderScript.pl to ActinicOrder.pm .

                          Kind regards,
                          Bruce King
                          SellerDeck

                          Comment


                            #28
                            Cheers Bruce, just changed it and it all works fine. You might want to get the AUG changed to include the v8.5.1 version of the amendment!
                            Cheers

                            David
                            Located in Edinburgh UK

                            http://twitter.com/mcfinster

                            Comment


                              #29
                              Yes, we will get that changed.

                              Regards,
                              Bruce King
                              SellerDeck

                              Comment


                                #30
                                Originally posted by berniejones

                                Find the section that looks like:

                                NETQUOTEDEL:GENERALPROMPT002
                                <tr>
                                <td bgcolor="NETQUOTEVAR:CHECKOUTBG">NETQUOTEVAR:GENERALPROMPT002</td>
                                <td bgcolor="NETQUOTEVAR:CHECKOUTBG">
                                <input type="TEXT" name="GENERALUSERDEFINED" size="40" maxlength="255" value="NETQUOTEVAR:GENERALUSERDEFINED">
                                </td>
                                </tr>
                                NETQUOTEDEL:GENERALPROMPT002


                                and replace it with:

                                <input type="Hidden" name="GENERALUSERDEFINED" value="NETQUOTEVAR:GENERALUSERDEFINED">


                                Now edit the perl script file OrderScript.pl

                                Find the subroutine named DisplayGeneralPhase by searching for 'sub DisplayGeneralPhase'

                                Towards the end of this, about 23 lines down, find the line:

                                $::s_VariableTable{$::VARPREFIX.'GENERALUSERDEFINED'} = ACTINIC::EncodeText2($::g_GeneralInfo{'USERDEFINED'});
                                I can't find any of this in ActinicOrder on 8.5.0
                                Fitness for life!www.fitness-focus.co.uk


                                DIFN - Doing nothing is not an option

                                The Supplement Warehouse - Bodybuilding & Fitness Supplements

                                Comment

                                Working...
                                X