I watch a tutorial on Youtube to create a login script, the login works, but the login does not connect to the admin panel. What am I doing wrong?
Thank you very much!
<?php
require_once "../blog/connect.php";
require_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://ift.tt/yaI000"></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"]){
require_once "inc/default.php";
}else {
}
if ($_POST) {
$kadi = p("kadi");
$sfire = p("sfire");
if (!$kadi || !$sfire) {
echo "Kullanici adi ve sifre bos birakilamaz..";
}else {
$query = query("SELECT * FROM uyeler WHERE uye_kadi = '$kadi' && uye_sfire = '$sfire' && uye_rutbe = 1");
if (mysql_affected_rows()){
$row = row($query);
$session = array(
"login" => true,
"uye_id" => $row["uye_id"],
"uye_rutbe" => $row["uye_rutbe"],
"uye_kadi" => $row["uye_kadi"]);
session_olustur($session);
go(URL."/admin");
}
else {
echo "<font color='red'>Boyle bir kullanici adi bulunmuyor</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="sfire" /></td>
</tr>
<tr>
<td></td>
<td><button type="submit">Giris yap</button></td>
</tr>
</table>
</form>
</div>
</body>
</html>
Aucun commentaire:
Enregistrer un commentaire