ACYN adlı üyeden alıntı:
mesajı görüntüle
Mesela içerik sildiriceksin. Orda içerik sildirmek için gerekli kodlar olucak işte
21
●1.534
<?php
if (isset($_SESSION["user"])) {
include("ayar.php");
$sql = ("select * from yonetici");
}
else {
header ("Location: giris.php");
}
?> <?php ob_start(); session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
if ( $_POST )
{
if ( $_POST['ka'] == "admin" && $_POST['sf'] == "123456" )
{
$_SESSION['admin'] = 1;
header("Location: admin.php");
exit;
}
else
{
echo '<font color="red">Kullanıcı adı veya şifre yanlış.</font>';
}
}
?>
<form action="index.php" method="post">
Kullanıcı adı : <input type="text" name="ka" /><br />
Şifre : <input type="password" name="sf" /><br />
<input type="submit" value="Giriş" />
</form>
</body>
</html>admin.php<?php ob_start(); session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
if ( $_SESSION['admin'] != 1 )
{
echo 'Giriş yapmamışmışsınız. <a href="index.php">Giriş</a>';
}
else
{
echo 'Hoşgeldin admin...';
}
?>
</body>
</html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1254">
<title>Yönetici Girişi</title>
<style type="text/css">
.ws6 {font-size: 8px;}
.ws7 {font-size: 9.3px;}
.ws8 {font-size: 11px;}
.ws9 {font-size: 12px;}
.ws10 {font-size: 13px;}
.ws11 {font-size: 15px;}
.ws12 {font-size: 16px;}
.ws14 {font-size: 19px;}
.ws16 {font-size: 21px;}
.ws18 {font-size: 24px;}
.ws20 {font-size: 27px;}
.ws22 {font-size: 29px;}
.ws24 {font-size: 32px;}
.ws26 {font-size: 35px;}
.ws28 {font-size: 37px;}
.ws36 {font-size: 48px;}
.ws48 {font-size: 64px;}
.ws72 {font-size: 96px;}
.wpmd {font-size: 13px;font-family: 'Arial';font-style: normal;font-weight: normal;}
DIV,UL,OL
{
margin-top: 0px;
margin-bottom: 0px;
}
</style>
<style type="text/css">
div#container
{
position:relative;
width: 859px;
margin-top: 0px;
margin-left: auto;
margin-right: auto;
text-align:left;
}
body {text-align:center;margin:0}
</style>
</head>
<body bgColor="#99CCFF">
<div id="container">
<div id="roundrect1" style="position:absolute; overflow:hidden; left:276px; top:64px; width:309px; height:271px; z-index:0"><img border=0 src="images/roundrect22985078.gif"></div>
<div id="text1" style="position:absolute; overflow:hidden; left:276px; top:78px; width:308px; height:39px; z-index:1"><div class="wpmd">
<div align=center><font class="ws22">ADMİN PANEL GİRİŞ</font></div>
</div></div>
<div id="text3" style="position:absolute; overflow:hidden; left:285px; top:150px; width:289px; height:119px; z-index:1">
<form action="" method="post">
<table width="100%">
<tr>
<td width="35%" bordercolor="#99CCFF">Kullanıcı Adı :</td>
<td width="65%" bordercolor="#99CCFF"><span style="color: navy; border-style: none; background-color: silver">
<input type="text" name="user" id="user" size="20">
</span></td>
</tr>
<tr>
<td bordercolor="#99CCFF">Şifre :</td>
<td bordercolor="#99CCFF"><span style="color: navy; border-style: none; background-color: silver">
<input type="password" name="sifre" is="sifre" size="20">
</span></td>
</tr>
<tr>
<td bordercolor="#99CCFF"> </td>
<td bordercolor="#99CCFF"><label>
<input type="submit" name="submit" id="submit" value="Giriş">
</label></td>
</tr>
</table>
<?php
if($_POST){
session_start();
include("ayar.php");
$sor= mysql_query("select * from yonetici where user = '".mysql_real_escape_string($_POST["user"])."' and sifre = '".mysql_real_escape_string($_POST["sifre"])."' ");
if(mysql_num_rows($sor)>0){
$_SESSION["yonetici"] = 1;
$_SESSION['user'] = $_POST['user'];
session_register();
header('Location: index.php');
}else{
echo "<script type='text/javascript'>
alert('Kullanıcı Adı veya Şifre Yanlış Lütfen Tekrar Deneyiniz.');
</script> ";
}
}
?>
</form>
</div>
</div></body>
</html>index.php<?php
session_start();
if($_SESSION["oturumvar"]!=1){
header('Location: giris.php');
exit;
}
?>mysql da bu şekilde belki burdan kaynaklıdır diye yaziyim dedim.CREATE TABLE IF NOT EXISTS `yonetici` ( `id` int(11) NOT NULL auto_increment, `user` varchar(10) character set utf8 NOT NULL default '', `ad` varchar(100) character set utf8 NOT NULL default '', `sifre` varchar(10) character set utf8 NOT NULL default '', `email` varchar(100) character set utf8 NOT NULL default '', PRIMARY KEY (`id`) );