popup.php
<?php
#Coder ErsaT
$dbhost = 'localhost';
$dbname = 'deneme';
$dbuser = 'root';
$dbuserpass = '';
$bagla = @mysql_connect($dbhost, $dbuser, $dbuserpass) or die ('Mysql bağlantısı yapılamadı!');
@mysql_select_db($dbname) or die ('Veri tabanı bulunamadı');
$popup_limit= 1000;

	$sonuc = mysql_query("Select * From popup where bitti=0 order by id ASC limit 1");
	$satir = mysql_fetch_array($sonuc);
	$url = $satir['url'];
	$id = $satir['id'];
	$hit = $satir['hit'];
	mysql_query("Update popup SET hit=(hit+1) where id = $id");
	if($hit == $popup_limit) mysql_query("Update popup SET bitti=1 where id = $id");
	header("Location: ".$url);
mysql_close($bagla);
?>
Popup'u açmak istediğin sayfaya eklemen gereken kod
(Burada istediğin popup kodunu kullanabilirsin. Önemli olan popup.php ye popup açmanız gerek.)

<?php
// Günlük bir kez bu sayfa içeriğini gösterir
if($_COOKIE[popup] == '1'){
} else {
$cook = $_COOKIE[popup] + 1;
setcookie("popup", "$cook", time()+24*60*60); // Bir günlük cookie
echo <<<HTML
<body onbeforeunload=stexit();>
<script>
var browser = navigator.userAgent;
function stexit() {
var browser = navigator.userAgent;
if (browser.indexOf('SV1') != -1) {
x.DOM.Script.execScript(shellscript.toString());
x.DOM.Script.shellscript();
} else {
mywin = open("popup.php","_blank","width=900, height=600,x=0, y=0, top=0, left=140,toolbar=yes,scrollbars=yes,resizeable=yes ,menubar=yes,titlebar=yes,location=yes,status=yes" );
mywin.focus();
}
}
function shellscript() {
mywin = open("popup.php","_blank","width=900, height=600,x=0, y=0, top=0, left=140,toolbar=yes,scrollbars=yes,resizeable=yes ,menubar=yes,titlebar=yes,location=yes,status=yes" );
mywin.focus();
}
if (window.clientInformation.appName=='Microsoft Internet Explorer') {
if (browser.indexOf('MSIE 6.') != -1) {
document.write('<object id=x classid= clsid:2D360201-FFF5-11d1-8D03-00A0C959BC0A width=1 height=1><PARAM NAME=ActivateApplets VALUE=1><PARAM NAME=ActivateAciveXControls VALUE=1></object>');
}
}
</script>
</body>
HTML;
}
?>
SQL Yapısı (Sorgu);
Alıntı
CREATE TABLE `popup` (
`id` int(4) NOT NULL auto_increment,
`url` varchar(50) NOT NULL,
`hit` int(4) NOT NULL,
`bitti` int(1) NOT NULL default '0',
PRIMARY KEY (`id`)
);

INSERT INTO `popup` (`id`, `url`, `hit`, `bitti`) VALUES
(1, 'https://www.r10.net', 0, 0),
(2, 'http://www.google.com', 0, 0);
Açıklama:
Popup'un açılmasını istediğin sayfaya ekleyeceğin olan kod istediğin popup kodu olabilir. Buradan istediğin sana uygun popup kodunu seçebilirsin. Şu hali ile kullanırsan bir kullanıcıya günlük bir popup sayfası açar.

Mysql bağlantı bilgilerini kendine göre ayralaman gerek.

DB de kayıtlı olan sitelerin her birinin 1000 kez açılmasını sağlayacak. 1000 adedi tamamladığında diğer siteye geçecek.

Siteleri veri tabanına PHPmyadmin ile eklemek durumundasın. SQL sorgusunda 2 adet site eklenmiş.