Просмотр файла banner.php

Размер файла: 1.42Kb
<?
/*
	#=====================================================#
	#              (c) 2006  Banner Rotate v.1            #
	#=====================================================#
	#            WAP site http://mega-wap.com.ru          #
    #            WEB site http://art-tech.net.ru          #
	#=====================================================#
	#                 Programmed By Demonaz               #
	#                    [email protected]                  #
	#=====================================================#
*/

include "config.php";

$banner_query = "SELECT * FROM user ORDER BY time ASC LIMIT 1";

if (!$banner_query) {
}$res = mysql_query($banner_query) or die(mysql_error());
$number = mysql_num_rows($res);if ($number == 0) {

print '<a href="add_banner.php"><img src="banner.gif" alt="&#1055;&#1086;&#1074;&#1077;&#1089;&#1100; &#1041;&#1072;&#1085;&#1085;&#1077;&#1088;!" /></a>';
exit;
}else{while ($row=mysql_fetch_array($res)){
$link = $row['link'];
$banner_link = $row['banner_link'];
$alt = $row['alt'];
$all = $row['all'];
$total = $row['total'];
$time = $row['time'];
}}

print '<a href="'.$link.'"><img src="'.$banner_link.'" alt="'.$alt.'" /></a>';

$total_plus = $total + 1;
@mysql_query("UPDATE user SET `total`=$total_plus WHERE time=$time;");

if ($total == $all){
$banner_delete_query = "DELETE FROM user WHERE time=$time LIMIT 1";
@mysql_query("$banner_delete_query");
}
?>