its about my login script.. here it is..
login.php:
<?
$username = $_POST['username'];
$passwd = md5($_POST['passwd']);
$dbuser = 'Blade';
$dbpass = '****';
//connect to the DB and select the database
$connection = mysql_connect('localhost', $dbuser, $dbpass)
or die(mysql_error());
mysql_select_db('Hazardnet', $connection) or die(mysql_error());
//set up the query
$query = "SELECT * FROM HN_users
WHERE username='$username' and passwd='$passwd'";
//run the query and get the number of affected rows
$result = mysql_query($query, $connection) or die("error making query");
$affected_rows = mysql_num_rows($result);
if($affected_rows == 1){
setcookie("username", $username, mktime (0, 0, 0, 12, 31, 2015)) or die("error");
setcookie("passwd", md5($passwd), mktime (0, 0, 0, 12, 31, 2015)) or die("error");
header("Location: [full url here]/members.php"); //this line is the problem......................*****[][][]
}
?>
it doesnt seem to be able to set the cookies before being redirected to the members page, what can i do to fix this?