i want to save the value of there username and password in field. so that next time they only have to hit login.
so i only have one file for login page.
login.php
//html code
<form id='login' action='login.php' method='POST'>
<input type="text" name="username" id="login_username" class="login_field" value="" />
<input type="password" name="password" id="login_password" class="login_field" value=""/>
<input type="checkbox" name="remember" id="login_remember" value="yes" />
<button type="submit">Log in</button>
</form>
//php code
<!-- Connect -->
//in side my header.php i have include connect, session...
<?php
include("include/header.php");
?>
<!-- REMEMBER PASSWORD SCRIPT-->
<?php
if(isset($_COOKIE['save']))
{
$user_name_c = $_COOKIE['save']['username'];
$password_c = $_COOKIE['save']['password'];
$query = "SELECT * FROM login WHERE username = '$username' AND password = '$password'";
$result = mysql_query($query);
if(mysql_num_rows($result))
{
$_SESSION['loggedin'] = 1;
header('Location:index.php');
exit();
}
}
?>
this doesnt save the value. also i want to make sure iam iam on right track. or should i try some thing different.