Arkadaşlar elimde üyelik gerektiren bir script var. Bu scripti bir siteye kurdum ancak bir sorun var. Kayıt ol kısmından kayıt olunca başarıyla kayıt olundu diyor ancak oraya girilen bilgilerle giriş yapmaya çalışınca böyle bir üyelik yok diyor. Kısacası orada yapılanlar Sql ye işlemiyor. Sql ye bakıyorum yeni üyelik açılmamış görünüyor. Yardım edebilir misiniz kaç gündür uğraşıyorum
functions.php kodları
<?php
ini_set('memory_limit', '-1');
ini_set('max_execution_time', 60);
ini_set('displayerrors', 0);
ob_implicit_flush();
error_reporting(E_ALL);
ini_set("display_errors", 0);
ignore_user_abort(false);
$config = include 'config.php';
extract($config);
session_start();
$Utilities = new Utilities;
$main_controller = new main_controller;
define('CR', "r"); // Carriage Return: Mac
define('LF', "n"); // Line Feed: Unix
define('CRLF', "rn"); // Carriage Return and Line Feed: Windows
define('BR', '<br />' . LF); // HTML Break
class Utilities {
private static $instance;
public $cache_time = 1800;
private $con;
private $result;
private $ayarlar;
public function __construct() {
global $config;
self::$instance = & $this;
if (isset($config) && !empty($config) && is_array($config)) {
extract($config);
$this->con = new PDO("mysql:host=" . $DB_SERVER . ";dbname=" . $DB_DATABASE, $DB_USERNAME, $DB_PASSWORD);
$this->con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
$queries = array("SET NAMES 'utf8'");
foreach ($queries as $query) {
$this->con->query($query);
}
}
}
public function __destruct() {
$this->con = NULL;
$this->result = NULL;
}
public function query($queryString, $bindValues = NULL, $fetch_style = PDO::FETCH_OBJ) {
$result = NULL;
$queryType = NULL;
if (preg_match("/updates([a-zA-Z0-9_]{1,20}+)sset/siU", $queryString, $table_match)):
$queryType = "UPDATE";
elseif (preg_match("/insertsintos([a-zA-Z0-9_]{1,20}+)/siU", $queryString, $table_match)):
$queryType = "INSERT";
elseif (preg_match("/deletesfroms([a-zA-Z0-9_]{1,20}+)/siU", $queryString, $table_match)):
$queryType = "DELETE";
elseif (preg_match("/froms*([a-zA-Z0-9_]{1,20}+)/siU", $queryString, $table_match)):
$queryType = "SELECT";
endif;
$query = $this->con->prepare($queryString);
if (isset($bindValues) && is_array($bindValues)) {
foreach ($bindValues as $key => $value) {
$key = ":" . $key;
$query->bindValue($key, $value, PDO::PARAM_STR);
}
}
$query->execute();
if ($queryType == "INSERT"):
$lastInsertId = $this->con->lastInsertId();
return $lastInsertId;
endif;
$result = new stdClass();
$rowCount = $query->rowCount();
$result->rowCount = $rowCount;
if ($queryType == "SELECT"):
$result->fetchAll = $query->fetchAll($fetch_style);
if (count($result->fetchAll) > 0):
$result->fetch = $result->fetchAll[0];
endif;
endif;
return $result;
}
public function insert($table, $data) {
$values = "";
$i = 0;
$keys = "";
$bindValues = array();
foreach ($data as $key => $val) {
$bindValues[$key] = $val;
$keys .= $i == 0 ? $key : ",$key";
$values .= (($i == 0) ? ":$key" : ", :$key");
$i++;
}
$sql = "INSERT INTO $table ($keys) values($values)";
return $this->query($sql, $bindValues);
}
public function update($table, $data, $where = NULL) {
$values = "";
$bindValues = array();
$i = 0;
foreach ($data as $key => $val) {
$bindValues[$key] = $val;
$values .= $i == 0 ? "$key = :{$key}" : ",$key = :{$key}";
$i++;
}
$sql = "UPDATE $table SET $values";
if ((isset($where) && $where)) {
if (is_array($where)) {
$_where = "";
$i = 0;
foreach ($where as $key => $value) {
$bindValues[$key] = $value;
$_where .= $i == 0 ? "{$key} = :$key" : " AND {$key} = :$key";
$i++;
}
$where = $_where;
}
$sql .= " WHERE $where ";
}
return $this->query($sql, $bindValues);
}
public function delete($table, $where = NULL, $bindValues = NULL) {
$values = "";
$i = 0;
$sql = "DELETE FROM $table ";
if ((isset($where) && $where)) {
if (is_array($where)) {
$_where = "";
$i = 0;
foreach ($where as $key => $value) {
$bindValues[$key] = $value;
$_where .= $i == 0 ? "{$key} = :$key" : " AND {$key} = :$key";
$i++;
}
$where = $_where;
}
$sql .= " WHERE $where ";
}
return $this->query($sql, $bindValues);
}
}
class main_controller {
public $Model;
public $Models;
public function __construct() {
global $Utilities, $ayarlar;
$script_name = str_replace("/", "\", $_SERVER["SCRIPT_FILENAME"]);
$script_name = str_replace("\", "/", $script_name);
$script_name = str_replace(realpath(dirname(__FILE__)), "", $script_name);
$scr = pathinfo($script_name);
$base_name = $scr["basename"];
$_do = $scr["basename"] . (isset($_GET["do"]) ? ("_" . $_GET["do"]) : "");
$queryString = parse_url($_SERVER["REQUEST_URI"], PHP_URL_QUERY);
parse_str($queryString, $queryString);
if (isset($queryString) && count($queryString) > 0) {
foreach ($queryString as $key => $val) {
if (!isset($_GET[$key]))
$_GET[$key] = $val;
}
}
if ($scr["basename"] == "login.php") {
if ($this->IsAuthenticated()) {
yonlendir(base_url());
} elseif ($_SERVER["REQUEST_METHOD"] == "POST") {
$username = $_POST["username"];
$password = $_POST["password"];
$giris = $Utilities->query("SELECT * FROM uyelikler WHERE username = :username and password =

assword" , array("username" => $username, "password" => $password));
if ($giris->rowCount > 0){
$ayar = $Utilities->query("SELECT * FROM uyelikler WHERE username = :username", array("username" => $username));
$ayarla = $ayar->fetch;
if ($ayarla->yetki == 0){
$sistemAktifmi = $Utilities->query("SELECT * FROM ayarlar ");
$cekBakalim = $sistemAktifmi->fetch;
if($cekBakalim->bakimModu == 0) {
$_SESSION["giris"] = TRUE;
$_SESSION['user'] = $username;
date_default_timezone_set('Europe/Istanbul');
$tarihi = date('d.m.Y H:i:s');
$update = array(
"songiris" => $tarihi,
"ipadresi" => $_SERVER["REMOTE_ADDR"]
);
$Utilities->update("uyelikler", $update, array("username" => $username));
yonlendir(base_url());
}else {
echo "<script>alert('Sistem bakimdadir lutfen daha sonra tekrar deneyiniz!');window.location.assign('login');</script>";
}
}else {
$_SESSION["giris"] = TRUE;
$_SESSION['user'] = $username;
date_default_timezone_set('Europe/Istanbul');
$tarihi = date('d.m.Y H:i:s');
$update = array(
"songiris" => $tarihi,
"ipadresi" => $_SERVER["REMOTE_ADDR"]
);
$Utilities->update("uyelikler", $update, array("username" => $username));
yonlendir(base_url());
}
}else {
echo "<script>alert('Giris Bilgileriniz Yanlis Bilgilerinizi Kontrol Edip Tekrar Deneyin!');</script>";
}
}
}
if ($this->IsAuthenticated()) {
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$redirect = NULL;
switch ($base_name):
default:
break;
endswitch;
if ($redirect):
yonlendir($redirect);
endif;
} else {
$redirect = NULL;
switch ($_do):
case "index.php_logout":
session_destroy();
yonlendir(base_url());
break;
case "otomatikEtkilesim.php_sil":
$id = $_GET["id"];
$tweet = $Utilities->query("SELECT * FROM otoetkilesim WHERE id = :id", array("id" => $id));
if ($tweet->rowCount > 0):
$Utilities->delete("otoetkilesim", array("id" => $id));
info_message(array("type" => "success", "msg" => " silindi!"));
else:
info_message(array("type" => "error", "msg" => "kayit bulunamadi!"));
endif;
$redirect = base_url("otomatikEtkilesim");
break;
case "manageAccount.php_sil":
$id = $_GET["id"];
$tweet = $Utilities->query("SELECT * FROM zamanliUnfollow WHERE id = :id", array("id" => $id));
if ($tweet->rowCount > 0):
$Utilities->delete("zamanliUnfollow", array("id" => $id));
info_message(array("type" => "success", "msg" => " silindi!"));
else:
info_message(array("type" => "error", "msg" => "kayit bulunamadi!"));
endif;
$redirect = base_url("manageAccount");
break;
case "hesapYukle.php_sil":
$id = $_GET["id"];
$tweet = $Utilities->query("SELECT * FROM hesaplist ");
if ($tweet->rowCount > 0):
$Utilities->delete("hesaplist");
info_message(array("type" => "success", "msg" => " silindi!"));
else:
info_message(array("type" => "error", "msg" => "kayit bulunamadi!"));
endif;
$redirect = base_url("hesapYukle");
break;
case "otomatikTweet.php_sil":
$id = $_GET["id"];
$tweet = $Utilities->query("SELECT * FROM ototweet WHERE id = :id", array("id" => $id));
if ($tweet->rowCount > 0):
$tweet = $tweet->fetch;
$silla = $tweet->tweet;
$Utilities->delete("ototweet", array("id" => $id));
info_message(array("type" => "success", "msg" => " silindi!"));
else:
info_message(array("type" => "error", "msg" => "kayit bulunamadi!"));
endif;
$redirect = base_url("otomatikTweet");
break;
case "otomatikTakip.php_sil":
$id = $_GET["id"];
$tweet = $Utilities->query("SELECT * FROM otoTakip WHERE id = :id", array("id" => $id));
if ($tweet->rowCount >