yazıyı eklerken bide input:hidden alanı oluştur orayada yazar id'sini çek. yazıyı kayıt yaparken de ordaki id'ye göre işlemini yap.
tam olarak nasıl yaparım hocam bunu
Login Sayfam bu hocam.
<?php
session_start();
include("config.php");
header('Content-Type: text/html; charset=utf-8');
ob_start(); session_start();
$admingirdi=$_SESSION['admin'];
error_reporting ( 0 );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="Description" content="<?php echo $site_tanitim;?>" />
<meta name="Keywords" content="<?php echo $site_etiketler;?> />
<meta http-equiv="Content-Type" content="text/html; charset=windows-1254" />
<meta name="Distribution" content="Global" />
<meta name="Author" content="<?php echo $site_admin;?> " />
<meta name="Robots" content="index,follow" />
<link rel="stylesheet" href="css/1.css" type="text/css" media="screen,projection" />
<title><?php echo $site_title;?></title>
</head>
<body>
<div id="wrap">
<div id="warp" align="center">
<?php
if(isset($_POST['submit'])){
$user=$_POST['user'];
$pass=$_POST['pass'];
$pass_md5=md5($pass);
$sql=mysql_query("Select * From ayarlar WHERE username='$user' AND password='$pass_md5'");
$varmi=mysql_num_rows($sql);
if($varmi>0){
$_SESSION['admin']="Admin";
header("Location:admin.php");
}
else{
echo "<h2>Kullanıcı Adınız veya Şifreniz Yanlış</h2>";
}
}
else{
?>
<?php
if ($admingirdi){
header("Location:admin.php");
}
else{
?>
<form action="login.php" method="post">
<br><br><br><br><br><br><br><br><br><br><br>
<font color="darklime"><h2>Giriş</h2></font>
<table align="center">
<tr>
<td>Kullanıcı Adınız : </td>
<td><input type="text" name="user" class="giris"/> </td>
</tr>
<tr>
<td>Şifreniz: </td>
<td><input type="password" name="pass" class="giris"/> </td>
</tr>
<tr>
<td><input type="submit" name="submit" value="Tamam" class="buton"/></td>
</tr>
</table>
</form>
<?php
}
}
?>
</div>
</body>
</html>