BW guard v0.1

Tüm saatler GMT +3 Saat


Full versiyon Görüntüle

YAZAR: huso
Tarih: 30/11/2008, 17:31



BW guard v0.1

<?

// Database configuration //

$dbhost = "localhost"; // Db server/host
$dbuser = "admin"; // Db username
$dbpass = "admin"; // Db password
$dbname = "guard"; // Dbname

// Database conf. ended //

// mySQL schema //
#############
#CREATE TABLE guard (
#id smallint(6) NOT NULL auto_increment,
#ip varchar(255) NOT NULL default '0',
#info varchar(255) NOT NULL default '',
#page varchar(255) NOT NULL default '',
#date varchar(255) NOT NULL default '',
#PRIMARY KEY (id), KEY id (id) ) TYPE=MyISAM;
###############################


// Your Global Variables //

$perm = "5"; // // Page view limit

// Global vars. ended //

// mySQL connection

@mysql_connect($dbhost,$dbuser,$dbpass) or die ("Can't connect to database.Modify your configuration file");

@mysql_select_db($dbname) or die ("Can't select database name.Modify your configuration file.");

// mySQL conn. ended //

// User defined vars //

$ip = $_SERVER['REMOTE_ADDR']; // Ip Addres

$info = $_SERVER['HTTP_USER_AGENT'];
// Browser info etc.

$page_self = $_SERVER['PHP_SELF'];

$querystring = $_SERVER['QUERY_STRING'];

$page ="$page_self$querystring";
// permalink - like guard.php?process=index

$date1 = date("dmy");
// Day - Month - Year [ like 18(.)05(.)2005 ]

// User defined vars ended //

// Inserting Data to SQL table //

$iceri = mysql_query("INSERT INTO `guard` (`ip`, `info`,`page`,`date1`) VALUES ('$ip', '$info','$page','$date1')");

// Insert Ended


$query = mysql_query("SELECT * FROM guard where ip='$ip' order by id desc limit 0,1");

while($output = mysql_fetch_array($query)) { $outdate = $output['date']; }

$tk="SELECT page FROM `guard` where date1='$date1' AND ip='$ip'";

$tk1= mysql_db_query($dbname,$tk);

$total_data = mysql_num_rows($tk1);

/* If user's limit expire , shoot "him/her/?" from page Wink */

if($total_data > "$perm" AND $outdate = $date1)

die(" Your page view limit expired($perm).Please wait <b>1</b> day and continue viewing pages<br>
<div align=right><i>Protected By [YNS]Bandwith Guard v0.1</div></i>");


/* After these phrases your page will be came.For script support or any idea for developing , you may say your idea
in my blog. ( [Linki görmek için üye olmanız gerekmektedir]***.net/ ) */



-> Hazır kodlar (php,asp,java,html) -> PDA Görünüm - Ana Sayfa
Tüm saatler GMT +3 Saat


Full versiyon Görüntüle



Phpbb PDA Görünüm
Muhendisiz.net Tarafindan Yazilmistir.
Writed by muhendisiz.net © 2004 - 2007 All rights reserved.