yazdığım kodde Cookie karşılaştırması yapamıyorum sorun ne olabilir
Kod: Tümünü seç
<?
session_start();
include 'conn.php';
extract($_POST);
if (isset($_REQUEST["c_kullanici"])){
$user_name = $_REQUEST["c_kullanici"];
$password = $_REQUEST["c_sifre"];
}
if (isset($user_name))
{
$sql_liste="select * from users where user_name = '" .$user_name. "' and password = '" .$password. "'";
$rec_liste=mysql_query($sql_liste);
if (!$rec_liste) {
die('Invalid query: ' . mysql_error());
}
$row = mysql_fetch_assoc($rec_liste);
if (mysql_num_rows($rec_liste) > 0) {
if ($row['USER_NAME'] == $user_name && $row['PASSWORD'] == $password)
{
$_SESSION['USER_NAME'] = $row['USER_NAME'];
$_SESSION['ID'] = $row['ID'];
$login = 1;
session_register('login');
if ($cookie_kaydet == 1)
{
setcookie('c_sifre', $password, 360000);
setcookie('c_kullanici', $user_name, 360000);
}
else
{
setcookie('c_sifre', "", time - 120);
setcookie('c_kullanici', "", time - 120);
}
}
}
mysql_free_result($rec_liste);
}
if($_SESSION['login']==1)
{
header("Location: index.php");
}