BVB Source Codes

Vehicle AdLogger v1.4.0 shu han edition Show ppc_click_logger.php Source code

Return Download Vehicle AdLogger v1.4.0 shu han edition: download ppc_click_logger.php Source code - Download Vehicle AdLogger v1.4.0 shu han edition Source code - Type:.php
  1. <?php
  2. /*#################################################################################
  3.         AdLogger
  4.         - An open-source tracking tool for preventing click fraud
  5.  
  6.         Copyright 2006 by Trevor Fitzgerald
  7.         http://www.adlogger.org
  8.  
  9.         This program is free software; you can redistribute it and/or
  10.         modify it under the terms of the GNU General Public License
  11.         as published by the Free Software Foundation; either version 2
  12.         of the License, or (at your option) any later version.
  13.  
  14.         This program is distributed in the hope that it will be useful,
  15.         but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17.         GNU General Public License for more details.
  18.  
  19.         You should have received a copy of the GNU General Public License
  20.         along with this program; if not, write to the Free Software
  21.         Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  22.  
  23.         If you find this script useful, please share it with others!
  24.  
  25.         Thank you!
  26. */#################################################################################
  27.  
  28. // Turn off error reporting so that if anything goes wrong, your visitor won't know
  29. error_reporting(0);
  30. session_start();
  31.  
  32. /*
  33. We don't want this page to be cached.  If it is, that might mean that some multiple
  34. clicks aren't properly logged.  These headers will tell the server not to allow any
  35. caching.
  36. */
  37. header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
  38. header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
  39. header("Cache-Control: no-store, no-cache, must-revalidate");
  40. header("Cache-Control: post-check=0, pre-check=0", false);
  41. header("Pragma: no-cache");
  42.  
  43. // Include the configuration files to connect to the database and find the current settings
  44. require ("../config_database.php");
  45.         /*
  46.         If the script can't establish a connection to the database, we might as well quit.
  47.         There's no point in continuing any further if we can't access the database.
  48.         */
  49.         if (!$adlogger_db_connect || !$adlogger_db_select) {
  50.                 exit();
  51.         }
  52. require ("../config_settings.php");
  53.  
  54. // Include the functions file where the all the functions are defined
  55. require ("./functions/functions.php");
  56.  
  57. // Set a variable of the visitor's IP address
  58. $visitor_ip = visitorIP();
  59.  
  60. // Set a variable with the proxy information, if exists
  61. $extrainfo = extra_IP_info();
  62.  
  63. // The visitor's User Agent information, with the ExtraInfo appended to it
  64. $visitor_agent = mysql_real_escape_string(htmlentities($_SERVER['HTTP_USER_AGENT']));
  65.         if (!empty($extrainfo)) {
  66.                 $visitor_agent .= " (Extra IP info: " . $extrainfo . ")";
  67.         }
  68.  
  69. // Grab the variables that were passed via the URL and set them as variables
  70. $ch_id = grab_from_url('ch_id');
  71. $ad_target = grab_from_url('targ');
  72. $ad_src = mysql_real_escape_string($_GET['src']);
  73.  
  74. // Parse the src so we can grab the good stuff
  75. parse_str($ad_src);
  76.  
  77. // Find out what page the visitor clicked an ad on
  78. if (isset($_GET['disp']) && !empty($_GET['disp'])) {
  79.         $disp_url = get_disp_page($_GET['disp']);
  80. } else {
  81.         $disp_url = get_disp_page($_SERVER['HTTP_REFERER']);
  82. }
  83.  
  84. // Try and determine the page that originally brought that visitor to your site.
  85. if (isset($_SESSION['adlog_ref']) && !empty($_SESSION['adlog_ref'])) {
  86.         $ref = get_disp_page($_SESSION['adlog_ref']);
  87. } else {
  88.         $ref = '';
  89. }
  90.  
  91. // Go ahead and insert all that information into a row in the database
  92. mysql_query("INSERT INTO " . $db_table_prefix . "adcheck_logs SET
  93.                 timestamp ='$timestamp',
  94.                 visitor_ip='$visitor_ip'
  95.         ");
  96.  
  97. mysql_query("INSERT INTO " . $db_table_prefix . "logfiles SET
  98.                 timestamp ='$timestamp',
  99.                 visitor_ip='$visitor_ip',
  100.                 visitor_agent='$visitor_agent',
  101.                 ch_id='$ch_id',
  102.                 disp_url='$disp_url',
  103.                 ref='$ref',
  104.                 targ_url='$ad_target',
  105.                 click_type='1',
  106.                 disp_time='$lmt',
  107.                 format='$format',
  108.                 color_bg='$color_bg',
  109.                 color_txt='$color_text',
  110.                 color_lnk='$color_link',
  111.                 color_url='$color_url',
  112.                 color_brd='$color_border',
  113.                 ad_type='$ad_type'
  114.         ");
  115.  
  116. $result_id = mysql_insert_id();
  117.  
  118. /*
  119. Find out how many ads this person has clicked recently.  "Recently" is any time
  120. between now and the click max time in the click fraud settings.
  121. */
  122. $backlog_timeframe = $timestamp - $clickmaxtime;
  123. $result = mysql_query("SELECT COUNT(visitor_ip) FROM " . $db_table_prefix . "logfiles WHERE visitor_ip = '$visitor_ip' AND timestamp > '$backlog_timeframe'");
  124.         $row = mysql_fetch_array($result);
  125.         $visitors_recent_clicks = $row['COUNT(visitor_ip)'];
  126.  
  127. // The current date and time relative to the AdLogger timezone setting
  128. $date = date('l, F j, Y', $timestamp);
  129. $time = date('g:i:s A', $timestamp);
  130.  
  131. /*
  132. If the option to receive Email Alerts is enabled AND
  133. the number of clicks from that visitor exceeds the
  134. "Alert me after so many emails.." number, then go ahead
  135. and sent the multiple click alert email
  136. */
  137. if ($email_alert && ($visitors_recent_clicks >= $emailalert_num)) {
  138.  
  139.         $msg = "AdLogger reports a multiple click by one of your visitors. The details of the report are below:<BR><BR>
  140.         Visitor IP - $visitor_ip<BR><BR>
  141.         Date/Time of click - $time on $date<BR><BR>
  142.         AdLogger estimates this person has clicked a total of $visitors_recent_clicks ads.<BR><BR>
  143.         Page of the click - <a href=\"" . $disp_url . "\">" . $disp_url . "</a><BR><BR><BR>
  144.         More information: <a href=\"" . $siteurl . $adlogger_loc . "/admin/click_info.php?id=" . $result_id . "\">" . $siteurl . $adlogger_loc . "/admin/click_info.php?id=" . $result_id . "</a>
  145.         ";
  146.  
  147.         $subject = "AdLogger Multiple Click Notification";
  148.         $mailheaders = "MIME-Version: 1.0\n";
  149.         $mailheaders .= "Content-type: text/html; charset=iso-8859-1\n";
  150.  
  151.         $to = $email;
  152.         $mailheaders .= "From: AdLogger <$email>\n";
  153.         $mailheaders .= "Reply-To: $email";
  154.  
  155.         mail($to, $subject, $msg, $mailheaders);
  156.  
  157. /*
  158. If the option to receive an email notice for clicks is enabled,
  159. go ahead and send the email
  160. */
  161. } elseif ($email_notice) {
  162.  
  163.         $msg = "AdLogger reports a click on your site. It reports the following:<BR><BR>
  164.         Visitor IP - $visitor_ip<BR><BR>
  165.         Date/Time of click - $time on $date<BR><BR>
  166.         Page of the click - <a href=\"" . $disp_url . "\">" . $disp_url . "</a><BR><BR><BR>
  167.         More information: <a href=\"" . $siteurl . $adlogger_loc . "/admin/click_info.php?id=" . $result_id . "\">" . $siteurl . $adlogger_loc . "/admin/click_info.php?id=" . $result_id . "</a>
  168.         ";
  169.  
  170.         $subject = "AdLogger Click Notification";
  171.         $mailheaders = "MIME-Version: 1.0\n";
  172.         $mailheaders .= "Content-type: text/html; charset=iso-8859-1\n";
  173.  
  174.         $to = $email;
  175.         $mailheaders .= "From: AdLogger <$email>\n";
  176.         $mailheaders .= "Reply-To: $email";
  177.  
  178.         mail($to, $subject, $msg, $mailheaders);
  179. }
  180. ?>
downloadppc_click_logger.php Source code - Download Vehicle AdLogger v1.4.0 shu han edition Source code
Related Source Codes/Software:
Flash voting system v1.2 - Modify the localization program abroad 2016-09-05
HpAdsNew v2.09 pr1 CMSware localization version - Can use it to build DoubleClick that third-party a... 2016-09-05
The Advanced Poll v2.08 multilingual version - Can set up multiple support voting procedures, can... 2016-09-05
Search (PHP edition v1.0 voting system - Search (PHP edition V1.0 voting system functions a... 2016-09-05
PHP character images online voting system v1.0.1 - The tripod with two handles peak network voting sy... 2016-09-04
Openads v2.0.11 multilingual version - A banner AD using PHP development management and t... 2016-09-05
Angel Upload Manager v1.0 - Ablog author works. Many friends asked me to, I wi... 2016-09-05
Good mood multi-user v1.1 news system - Function description: 2016-09-05
V2.0 prodigal news system - 1, article categories: unlimited categories, and i... 2016-09-05
PHPNovelС˵ϵͳv4.0.6 - PHPNovel is a set of using PHP + mysql database op... 2016-09-05
mockery - Mockery is a simple yet flexible PHP mock object f... 2017-03-31
redisson - Redisson - distributed Java objects and services (... 2017-03-31
flow.js - A JavaScript library providing multiple simultaneo... 2017-03-31
Google-Maps-for-Rails - Enables easy Google map + overlays creation in Rub... 2017-03-31
DCIntrospect - Small library of visual debugging tools for iOS. 2017-03-31
Mining-the-Social-Web-2nd-Edition - The official online compendium for Mining the Soci... 2017-03-31
TensorFlow-Book - Accompanying source code for Machine Learning with... 2017-03-31
js-interview-review - The JS interview review. As I'm reviewing several ... 2017-03-31
script.js - Asyncronous JavaScript loader and dependency manag... 2017-03-31
dex-method-counts - Command-line tool to count per-package methods in ... 2017-03-31

 Back to top