Changeset 42 for banners/banner.php


Ignore:
Timestamp:
Jan 29, 2009, 12:18:39 PM (16 years ago)
Author:
george
Message:
  • Opraveno: Sledování odkazovaných adres na bannery.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • banners/banner.php

    r41 r42  
    88$Database->SelectDatabase($Config['Database']['Database']);   
    99
    10 header('Content-Type: image/png');
     10//header('Content-Type: image/png');
    1111$Referer = addslashes($_SERVER['HTTP_REFERER']);
    12 $Database->SQLCommand('REPLACE INTO `banner` (`Web`, `DateLast`) VALUES ("'.$Referer.'",NOW() )');
     12$DbResult = mysql_query('SELECT * FROM `banner` WHERE `Web` = "'.$Referer.'"', $Database->id_connection);
     13if(mysql_num_rows($DbResult) > 0)
     14  $Database->SQLCommand('UPDATE `banner` SET `DateLast` = NOW() WHERE `Web` = "'.$Referer.'"');
     15  else mysql_query('INSERT INTO `banner` (`Web`, `DateFirst`, `DateLast`) VALUES ("'.$Referer.'", NOW(), NOW( ))', $Database->id_connection);
    1316$Image = imagecreatefromjpeg(addslashes($_GET['image']));
    1417imagepng($Image);
Note: See TracChangeset for help on using the changeset viewer.