include 'functions.php';
$kod = $_POST["kod"];
if ($kod != $_SESSION["kod"]){
echo '0';
} else {
echo '1';
}
?>
fonksiyon.php
ob_start();
session_set_cookie_params(0, '/', '.'.str_replace('www.','',$_SERVER['HTTP_HOST']));
session_name('ses_name');
session_start();
error_reporting(0);
ini_set("display_errors",0);
try {
$db = new PDO("mysql:host=localhost;dbname=dddd", "dddd", "dddd",array(PDO::MYSQL_ATTR_INIT_COMMAND =>"SET NAMES utf8",PDO::MYSQL_ATTR_INIT_COMMAND => "SET CHARACTER SET utf8",array( PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION )));
} catch ( PDOException $e ){
print $e->getMessage();
}
$siteurl = "https://www.ddddd.com"; // Site adresim format: https://www.ddddd.com
$gzip_pres = true;
function gzipKontrol()
{
$kontrol = str_replace(" ","", strtolower($_SERVER['HTTP_ACCEPT_ENCODING']));
$kontrol = explode(",", $kontrol);
return in_array("gzip", $kontrol);
}
function bosluksil($kaynak)
{
return preg_replace("/\s+/", " ", $kaynak);
}
function kaynak_presle($kaynak)
{
global $gzip_pres;
$sayfa_cikti = bosluksil($kaynak);
if (!gzipKontrol() || headers_sent() || !$gzip_pres)
return $sayfa_cikti;
header("Content-Encoding: gzip");
return gzencode($sayfa_cikti);
}
$sql = $db ->query("SELECT * FROM ayarlar");
$row = $sql->fetch(PDO::FETCH_ASSOC);
$mail_port = $row["mail_port"];
$mail_server = $row["mail_server"];
$mail_kullaniciadi = $row["mail_kullaniciadi"];
$mail_parola = $row["mail_parola"];
$siteadi = $row["siteadi"];
$mail_gonderen = $row["mail_gonderen"];
$admin_mail = $row["admin_mail"];
$magazasinir = $row["ilan_siniri"];
$getkomisyon = $row["get_komisyon"];
$resimserverurl = $row["resim_server"];
$paypal = $row["paypal"];
$logo = $row["logo"];
$facebook = $row["facebook"];
$twitter = $row["twitter"];
$googleplus = $row["googleplus"];
$renk = $row["renk"];
foreach ($_GET as $key => $value)
{
if ($value == ""){ $value = ""; }
$value = str_replace('"', "", $value);
$value = str_replace("'", "", $value);
$value = str_replace("select", "", $value);
$value = str_replace("SELECT", "", $value);
$value = str_replace("UPDATE", "", $value);
$value = str_replace("update", "", $value);
$value = str_replace("delete", "", $value);
$value = str_replace("DELETE", "", $value);
$value = str_replace("UNION", "", $value);
$value = str_replace("union", "", $value);
$value = str_replace('"', "", $value);
$value = str_replace("%", "", $value);
$value = str_replace("`","", $value);
$value = str_replace("'","'", $value);
$value = str_replace("-","-", $value);
$value = str_replace("%","", $value);
$value = str_replace("<","", $value);
$value = str_replace(">","", $value);
$_GET[$key] = $value;
}
foreach ($_POST as $key => $value)
{
if ($key == "editor1" || $key == "acikalama"){
if ($value == ""){ $value = " "; }
$_POST[$key] = htmlentities($value);
} else {
if ($value == ""){ $value = " "; }
$value = str_replace('"', "", $value);
$value = str_replace("'", "", $value);
$value = str_replace("select", "", $value);
$value = str_replace("SELECT", "", $value);
$value = str_replace("UPDATE", "", $value);
$value = str_replace("update", "", $value);
$value = str_replace("delete", "", $value);
$value = str_replace("DELETE", "", $value);
$value = str_replace("UNION", "", $value);
$value = str_replace("union", "", $value);
$value = str_replace('"', "", $value);
$value = str_replace("`","", $value);
$value = str_replace("'","'", $value);
$value = str_replace("-","-", $value);
$value = str_replace("<","", $value);
$value = str_replace(">","", $value);
$_POST[$key] = $value;
}
}
function guvenlik($aa){
return $aa;
}
function duzelt($metin)
{
$bul = array("ý","Ý","Ð","Þ"); $duzelt = array("ı","İ","Ğ","Ş"); $metin = str_replace($bul, $duzelt, $metin ); //baslik hazır
return $metin;
}
##SEO URL
function seo($str, $options = array()) {
$str = mb_convert_encoding((string)$str, 'UTF-8', mb_list_encodings());
$defaults = array(
'delimiter' => '-',
'limit' => null,
'lowercase' => true,
'replacements' => array(),
'transliterate' => true,
);
$options = array_merge($defaults, $options);
$char_map = array('Ş' => 'S', 'İ' => 'I', 'Ç' => 'C', 'Ü' => 'U', 'Ö' => 'O', 'Ğ' => 'G','ş' => 's', 'ı' => 'i', 'ç' => 'c', 'ü' => 'u', 'ö' => 'o', 'ğ' => 'g',);
$str = preg_replace(array_keys($options['replacements']), $options['replacements'], $str);
if ($options['transliterate']) {
$str = str_replace(array_keys($char_map), $char_map, $str);
}
$str = preg_replace('/[^\p{L}\p{Nd}]+/u', $options['delimiter'], $str);
$str = preg_replace('/(' . preg_quote($options['delimiter'], '/') . '){2,}/', '$1', $str);
$str = mb_substr($str, 0, ($options['limit'] ? $options['limit'] : mb_strlen($str, 'UTF-8')), 'UTF-8');
$str = trim($str, $options['delimiter']);
return $options['lowercase'] ? mb_strtolower($str, 'UTF-8') : $str;
}
#############################################################################################
function substr_unicode($str, $s, $l = null) {
return join("", array_slice(
preg_split("//u", $str, -1, PREG_SPLIT_NO_EMPTY), $s, $l));
}
#SAYFALA
#############################################################################################
function sayfala($suanda,$iceriksay,$limit,$sayfa,$uzanti) {
$onceki = $suanda - 1;
$sonraki = $suanda + 1;
$sonsayfa = ceil($iceriksay / $limit);
$ileri = $suanda + 4;
if($ileri > $sonsayfa) $ileri = $sonsayfa;
$geri = $suanda - 4;
if($geri < 1) $geri = 1;
$sayfalar = "";
if($sonsayfa > 1) {
$sayfalar .= '';
if($suanda > 1) {
$sayfalar .= '- «
';
}
for($i=$geri;$i<$suanda;$i++) {
$sayfalar .= '- '.$i.'
';
}
$sayfalar .= '- '.$suanda.'
';
for($i=$suanda+1;$i<=$ileri;$i++) {
$sayfalar .= '- '.$i.'
';
}
if($suanda < $sonsayfa) {
$sayfalar .= '- »
';
}
$sayfalar .= "
";
}
return $sayfalar;
}
##GÜN
#############################################################################################
function aybul($tarih)
{
$ay = $tarih;
$ayadlari = array( "01" => "Ocak", "02" => "Şubat", "03" => "Mart", "04" => "Nisan", "05" => "Mayıs", "06" => "Haziran", "07" => "Temmuz", "08" => "Ağustos", "09" => "Eylül", "10" => "Ekim", "11" => "Kasım", "12" => "Aralık" );
$tarih = $ayadlari[$ay];
return $tarih;
}
function ay($tarih)
{
$tarih = preg_split( "/[-\\:\\/ ]/", $tarih);
$gun = $tarih[2];
$ay = $tarih[1];
$yil = $tarih[0];
$ayadlari = array( "01" => "Ocak", "02" => "Şubat", "03" => "Mart", "04" => "Nisan", "05" => "Mayıs", "06" => "Haziran", "07" => "Temmuz", "08" => "Ağustos", "09" => "Eylül", "10" => "Ekim", "11" => "Kasım", "12" => "Aralık" );
$tarih = $gun." ".$ayadlari[$ay]."
".$yil;
return $tarih;
}
function ay2($tarih)
{
$tarih = preg_split( "/[-\\:\\/ ]/", $tarih);
$gun = $tarih[2];
$ay = $tarih[1];
$yil = $tarih[0];
$ayadlari = array( "01" => "Ocak", "02" => "Şubat", "03" => "Mart", "04" => "Nisan", "05" => "Mayıs", "06" => "Haziran", "07" => "Temmuz", "08" => "Ağustos", "09" => "Eylül", "10" => "Ekim", "11" => "Kasım", "12" => "Aralık" );
$tarih = $gun." ".$ayadlari[$ay]." ".$yil;
return $tarih;
}
##RASGELE SAYI HARF
function uretken($len) {
$karaktersizler = strtoupper("abcdefghijklmnopqrstuvwxyz0123456789");
$xx= "";
$max = strlen($karaktersizler)-1;
for ($i = 0; $i < $len; $i++) {
$xx.= $karaktersizler[rand(0,$max)];
}
return $xx;
}
function fiyat2($fi,$kur){
$temizle = str_replace(".","",$fi);
$temizle = str_replace(",","",$fi);
$kachane = strlen($temizle);
if ($kachane == 1){
$fiyat = $temizle;
} elseif ($kachane == 2){
$fiyat = $temizle;
} elseif ($kachane == 3){
$fiyat = $temizle;
} elseif ($kachane == 4){
$fiyat = substr($temizle,0,1).".".substr($temizle,1,3);
} elseif ($kachane == 5){
$fiyat = substr($temizle,0,2).".".substr($temizle,2,3);
} elseif ($kachane == 6){
$fiyat = substr($temizle,0,3).".".substr($temizle,3,3);
} else {
$fiyat = substr($temizle,0,1).".".substr($temizle,1,3).".".substr($temizle,4,3);
}
return $fiyat;
}
function fiyat($fi){
$p = explode(".",$fi);
$kachane = strlen($p[0]);
if ($p[1] == 00){
$fiyat = $p[0];
} else {
$fiyat = $p[0].".".$p[1]."";
}
$p = explode(".",$fiyat);
if ($p[1] == ""){ $p1[1] = ""; } else { $p[1] = ".".$p[1];}
if (strlen($p[0]) == 4){
$fiyat = substr($p[0],0,1).".".substr($p[0],1,3).$p[1];
}
if (strlen($p[0]) == 5){
$fiyat = substr($p[0],0,2).".".substr($p[0],2,3).$p[1];
}
if (strlen($p[0]) == 6){
$fiyat = substr($p[0],0,3).".".substr($p[0],3,3).$p[1];
}
if (strlen($p[0]) == 7){
$fiyat = substr($p[0],0,4).".".substr($p[0],4,3).$p[1];
}
if (strlen($p[0]) == 8){
$fiyat = substr($p[0],0,5).".".substr($p[0],5,3).$p[1];
}
return $fiyat;
}
function full_url()
{
$s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
$sp = strtolower($_SERVER["SERVER_PROTOCOL"]);
$protocol = substr($sp, 0, strpos($sp, "/")) . $s;
$port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
$zz = $protocol . "://" . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI'];
$pos = strpos($zz, "git");
if ($pos === false) { if (guvenlik($_GET['durumu']) == ""){ return $zz = $zz."?git=1"; } else { return $zz = $zz."&git=1"; } } else { return $zz = $zz; }
}
$kucuk = array('ç', 'ğ', 'i', 'ı', 'ö', 'ş', 'ü');
$buyuk = array('Ç', 'Ğ', 'İ', 'I', 'Ö', 'Ş', 'Ü');
function tr_strtolower($metin) {
global $kucuk, $buyuk;
return strtolower(str_replace($buyuk, $kucuk, $metin));
}
function tr_ucfirst($metin, $e='utf-8') {
$ik = tr_strtoupper(mb_substr($metin, 0, 1, $e), $e);
return $ik.mb_substr($metin, 1, mb_strlen($metin, $e), $e);
}
if ($_GET['dil'] == ""){
if ($_SESSION["dil"] == ""){
$_SESSION["dil"] = 1;
} else {
$_SESSION["dil"] = $_SESSION['dil'];
}} else {
$_SESSION["dil"] = $_GET["dil"];
$ref = $_SERVER['HTTP_REFERER'];
header("location: $ref");
}
$dil = array();
$dd = $_SESSION['dil'];
$sql = $db->query("SELECT * FROM diller WHERE Id = '$dd' ORDER BY Id ASC");
$a = $sql->fetch(PDO::FETCH_ASSOC);
$yon = $a["yon"];
$sql = $db->query("SELECT * FROM dil WHERE dil = '$dd' ORDER BY Id ASC");
while ($a = $sql->fetch(PDO::FETCH_ASSOC)){
$dil[] = $a["kelime"];
}
function banner($id)
{
global $db;
$dilx = $_SESSION["dil"];
if ($dilx == 1){
$sql = $db->query("SELECT * FROM banner WHERE Id = '$id'");
} else {
$sql = $db->query("SELECT * FROM banner_ceviri WHERE bannerId = '$id' and dilId = '$dilx'");
}
$a = $sql->fetch(PDO::FETCH_ASSOC);
$ban = html_entity_decode($a["icerik"]);
return $ban;
}
$dil_no = array();
$sql = $db->query("SELECT * FROM dil WHERE dil = '1' ORDER BY Id ASC");
while ($a = $sql->fetch(PDO::FETCH_ASSOC)){
$dil_no[] = $a["kelime"];
}
?>