Ignore:
Timestamp:
Apr 22, 2009, 10:58:57 AM (16 years ago)
Author:
george
Message:
  • Upraveno: Lepší filtrování vkládání adres odkazů na banner a záznam plného posledního URL z dané domény.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/banners/banner.php

    r67 r185  
    66$Referer = addslashes($_SERVER['HTTP_REFERER']);
    77$Referer = substr($Referer, strpos($Referer, '/') + 2);
    8 $Referer = 'http://'.substr($Referer, 0, strpos($Referer, '/')).'/';
    9 $DbResult = mysql_query('SELECT * FROM `banner` WHERE `Web` = "'.$Referer.'"', $Database->id_connection);
    10 if(mysql_num_rows($DbResult) > 0)
    11   $Database->SQLCommand('UPDATE `banner` SET `DateLast` = NOW() WHERE `Web` = "'.$Referer.'"');
    12   else mysql_query('INSERT INTO `banner` (`Web`, `DateFirst`, `DateLast`) VALUES ("'.$Referer.'", NOW(), NOW( ))', $Database->id_connection);
     8$HostName = substr($Referer, 0, strpos($Referer, '/'));
     9if(substr($HostName, -1) == '.') $HostName = substr($HostName, 0, -1);
     10if($HostName != gethostbyname($HostName))
     11{
     12  $Referer = 'http://'.$HostName.'/';
     13  $DbResult = mysql_query('SELECT * FROM `banner` WHERE `Web` = "'.$Referer.'"', $Database->id_connection);
     14  if(mysql_num_rows($DbResult) > 0)
     15    $Database->SQLCommand('UPDATE `banner` SET `DateLast` = NOW(), `LastURL` = "'.addslashes($_SERVER['HTTP_REFERER']).'" WHERE `Web` = "'.$Referer.'"');
     16    else mysql_query('INSERT INTO `banner` (`Web`, `DateFirst`, `DateLast`, LastURL`) VALUES ("'.$Referer.'", NOW(), NOW( ), "'.addslashes($_SERVER['HTTP_REFERER']).'")', $Database->id_connection);
     17}
     18
    1319$Image = imagecreatefromjpeg(addslashes($_GET['image']));
    1420imagepng($Image);
Note: See TracChangeset for help on using the changeset viewer.