- sitesindeki sorunu ve ne yapabileceğimi söyleyebilecek biri varmı
8
●634
<?php
//DB baglanti
function db_baglanti()
{
$db_host = "localhost";
$db_kullanici = "****"; // Db kullanici adiniz
$db_sifre = "*****"; // Db sifreniz
$db_adi = "*****"; // Db adiniz
$baglanti = @mysql_connect($db_host,$db_kullanici,$db_sifre);
if(!$baglanti){ die("Database Bağlantısı Sağlanamadı: " . mysql_errno()); }
$select = @mysql_select_db($db_adi,$baglanti);
if(!$select){ die("Database Seçilemedi: " . mysql_errno()); }
@mysql_query("SET NAMES 'latin5'");
@mysql_query("SET CHARACTER SET latin5");
@mysql_query("SET COLLATION_CONNECTION = 'latin5_turkish_ci'");
@mysql_free_result($baglanti);
}
if(file_exists("../install.php")):
$log = explode('/',$_SERVER['PHP_SELF']);
if($log[2] != "install.php"):
header("Location: install.php");
exit;
endif;
endif;
?> <?php
/* $db_host = "localhost";
$db_kullanici = "*********";
$db_sifre = "*******";
$db_adi = "*******";
@$baglanti = mysql_connect($db_host,$db_kullanici,$db_sifre) or die ("Veri Tabanýna Baðlanýlamýyor..");
@ mysql_select_db($db_adi,$baglanti) or die("Veritabaný Bulunamadý..");
mysql_query("SET NAMES 'latin5'");
mysql_query("SET CHARACTER SET latin5");
mysql_free_result($baglanti); */
require_once("config.inc.php");
db_baglanti();
$sorgu = mysql_query("Select * from ayarlar where id='1'");
$veri = mysql_fetch_array($veri);
//Gerekli Bilgiler..
$siteadi = $veri['siteadi'];
$siteadresi = $veri['site'];
$slogan = $veri['Makale, Makaleler, Bilgi Bankasi']; // Site Slogani..
$site_mail = $veri['mail']; //Admin Mail
$adsense = $veri['adsense']; //adsense pub_no
$sinir = $veri['sinir'];
$boyut = $veri['sifre'];
$uzun = $veri['guvenlik'];
$uyelik = $veri['uyelik'];
$cookie = $veri['Cookie'];
//sayfalama limiti..
function LIMIT()
{
global $sinir;
$limit = $sinir;
return $limit;
}
//Yeni þifre taleplerinde kullanýlýr
function SifreUret() {
global $boyut;
$plength = $boyut;
if(!is_numeric($plength) || $plength <= 0) {
$plength = 8;
}
if($plength > 32) {
$plength = 32;
}
$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
mt_srand(microtime() * 1000000);
for($i = 0; $i < $plength; $i++) {
$key = mt_rand(0,strlen($chars)-1);
$pwd = $pwd . $chars{$key};
}
for($i = 0; $i < $plength; $i++) {
$key1 = mt_rand(0,strlen($pwd)-1);
$key2 = mt_rand(0,strlen($pwd)-1);
$tmp = $pwd{$key1};
$pwd{$key1} = $pwd{$key2};
$pwd{$key2} = $tmp;
}
return $pwd;
}
//Güvenlik resmi üretmek için..
function ResimUret() {
global $uzun;
$uzunluk = $uzun;
session_start();
header ("Content-type: image/png");
srand((double)microtime() * 1000000);
# Guvenlik kodu
$kod = substr(md5(uniqid(rand())),0,$uzunluk);
$_SESSION["kod"] = $kod; // Kodu oturuma kaydet
# Fontlar ..
$font = array(
"arial.ttf",
"tahoma.ttf",
"verdana.ttf",
"enya.ttf",
"inkburro.ttf",
"marydale.ttf",
);
# Resmi hazýrla
$resim = @imagecreate((strlen($kod)*20)+20,50);
$zemin = imagecreatefrompng('zemin.png');
$metin = imagecolorallocate ($resim, 0, 0, 0);
imagesettile($resim,$zemin);
imagefilledrectangle($resim,0,0,(strlen($kod)*20)+20,50,IMG_COLOR_TILED);
# Kodu bas ..
for($i=0; $i < strlen($kod); $i++){
shuffle($font);
imagettftext($resim, 20, 0, 10+($i*20),35, $metin, "Font/".current($font),$kod[$i]);
}
# Resmi Çýkart
imagepng($resim);
imagedestroy($resim);
}
//db_Baglanti_kapat();
?>