Changeset 185 for trunk/banners/banner.php
- Timestamp:
- Apr 22, 2009, 10:58:57 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/banners/banner.php
r67 r185 6 6 $Referer = addslashes($_SERVER['HTTP_REFERER']); 7 7 $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, '/')); 9 if(substr($HostName, -1) == '.') $HostName = substr($HostName, 0, -1); 10 if($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 13 19 $Image = imagecreatefromjpeg(addslashes($_GET['image'])); 14 20 imagepng($Image);
Note:
See TracChangeset
for help on using the changeset viewer.