Jump to content

Ersan

New Members
  • Posts

    3
  • Joined

  • Last visited

Ersan's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. @Ginerjm, I get the errors: Notice: Undefined index: login in C:\Users\Ersan\XAMPP\htdocs\blog\functie.php on line 35 Fatal error: Call to undefined method PDO::fetch() in C:\Users\Ersan\XAMPP\htdocs\admin\index.php on line 74 You can see the line numbers on these websites: index.php: http://pastie.org/10115184#8 functie.php: http://pastie.org/10115193 connect.php: http://pastie.org/10115194 Thank you very much!
  2. Ginerjm, I get the errors: Notice: Undefined index: login and Call to undefined method PDO::fetch() It is also at the top of the page.
  3. I looked at a tutorial on youtube to make a blog. I need to be connected after logging in my admin login with the admin panel. What is my mistake here? Thank you very much! index.php <?php include_once "../blog/connect.php"; include_once "../blog/functie.php"; ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"/> <title>Dashboard I Admin Panel</title> <link rel="stylesheet" href="css/layout.css" type="text/css" media="screen" /> <!--[if lt IE 9]> <link rel="stylesheet" href="css/ie.css" type="text/css" media="screen" /> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <script src="js/jquery-1.5.2.min.js" type="text/javascript"></script> <script src="js/hideshow.js" type="text/javascript"></script> <script src="js/jquery.tablesorter.min.js" type="text/javascript"></script> <script type="text/javascript" src="js/jquery.equalHeight.js"></script> <script type="text/javascript"> $(document).ready(function() { $(".tablesorter").tablesorter(); } ); $(document).ready(function() { //When page loads... $(".tab_content").hide(); //Hide all content $("ul.tabs li:first").addClass("active").show(); //Activate first tab $(".tab_content:first").show(); //Show first tab content //On Click Event $("ul.tabs li").click(function() { $("ul.tabs li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(".tab_content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content $(activeTab).fadeIn(); //Fade in the active ID content return false; }); }); </script> <script type="text/javascript"> $(function(){ $('.column').equalHeight(); }); </script> </head> <body> <?php if(session("login") && session("uye_rutbe") == 1){ require_once "inc/default.php"; }else{ } if ($_POST){ $kadi= p("kadi"); $sifre = md5(p("sifre")); if (!$kadi || !$sifre){ echo "kullanıcı adı sifre bos bırakılamaz"; } else{ $row = $connect->query("SELECT * FROM uyeler WHERE uye_kadi = '$kadi' && uye_sifre = '$sifre'"); $row = $connect->fetch(PDO::FETCH_ASSOC); if ( $row["uye_id"]) { $session = array( "giris_yap" => true, "uye_id" => $row["uye_id"], "uye_kadi" => $row["uye_kadi"], "uye_rutbe" => $row["uye_rutbe"] ); session_olustur($session); header("Refresh:0;"); } else { echo "<font color='red'>Böyle Bir Yönetici Yoktur.</font>"; } } } ?> <div id="giris_yap"> <form action="" method="post"> <table cellpadding="0" cellspacing="0"> <tr> <td>Gebruikersnaam:</td> <td><input type="text" name="kadi" /></td> </tr> <tr> <td>Wachtwoord:</td> <td><input type="password" name="sifre" /></td> </tr> <tr> <td></td> <td><button type="submit">Inloggen</button></td> </tr> </table> </form> </div> </body> </html> function.php <?php function p($par, $st =false){ if($st){ return htmlspecialchars(trim($_POST[$par])); }else{ return trim( $_POST[$par]); } } function g($par){ return strip_tag(trim($_GET[$par])); } function kisalt($par,$uzunluk = 50){ if(strlen($par) > $uzunluk){ $par=mb_substr($par,0,$uzunluk,"UTF-8").". ."; } return $par; } function go($par, $time = 0){ if($time == 0){ header("Location: {$par}"); }else{ header("Refresh: {$time}; url={$par}"); } } function session($par){ if ($_SESSION[$par]){ return $_SESSION[$par]; }else{ return false; } } function session_olustur($par){ foreach ($par as $anahtar => $deger){ $_SESSION[$anahtar]=$deger; } } function sef_link($url){ $url = trim($url); $url = strtolower($url); $find = array('<b>', '</b>'); $url = str_replace ($find, '', $url); $url = preg_replace('/<(\/{0,1})img(.*?)(\/{0,1})\>/', 'image', $url); $find = array(' ', '"', '&', '&', '\r\n', '\n', '/', '\\', '+', '<', '>'); $url = str_replace ($find, '-', $url); $find = array('é', 'è', 'ë', 'ê', 'É', 'È', 'Ë', 'Ê'); $url = str_replace ($find, 'e', $url); $find = array('í', 'ì', 'î', 'ï', 'I', 'Ã', 'ÃŒ', 'Ã', 'Ã', 'Ä°', 'ı'); $url = str_replace ($find, 'i', $url); $find = array('ó', 'ö', 'Ö', 'ò', 'ô', 'Ó', 'Ã’', 'Ô'); $url = str_replace ($find, 'o', $url); $find = array('á', 'ä', 'â', 'à ', 'â', 'Ä', 'Â', 'Ã', 'À', 'Â'); $url = str_replace ($find, 'a', $url); $find = array('ú', 'ü', 'Ãœ', 'ù', 'û', 'Ú', 'Ù', 'Û'); $url = str_replace ($find, 'u', $url); $find = array('ç', 'Ç'); $url = str_replace ($find, 'c', $url); $find = array('Å', 'ÅŸ'); $url = str_replace ($find, 's', $url); $find = array('Ä', 'ÄŸ'); $url = str_replace ($find, 'g', $url); $find = array('/[^a-z0-9\-<>]/', '/[\-]+/', '/<[^>]*>/'); $repl = array('', '-', ''); $url = preg_replace ($find, $repl, $url); $url = str_replace ('--', '-', $url); return $url; } function query($query){ return mysql_query($query); } function row($query){ return mysql_fetch_array($query); } function rows($query){ return mysql_num_rows($query); } { } ?> Connect.php <?php session_start(); $host = "localhost"; $database = "blog"; $user = "root"; $password = ""; try { $connect = new PDO("mysql:localhost={$host};dbname={$database}", $user, $password, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")); $connect->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING ); } catch (PDOException $e) { return 'Hay Allah!, Connection Error: '. $e->getMessage(); } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.