is setcookie funtion a header call?
as i checked my connect.php and the script where setcookie is called, i dont have any white space or outputs. Here is my connect.php:
Code: Select all
<?php
include 'mysql.php';
$db = new DBLayer('localhost', 'user', 'pass', 'database', '', false);
?>
here is my script that sets the cookie:
Code: Select all
<?
include 'methods.php';
$do = $_GET['act'];
$user = trim($_POST['username']);
$pass = trim($_POST['password']);
if($do == 'verify')
{
if($user == '' || $pass == '')
{
alert('Please type both username and password to login!');
redirect('http://www.rscheetah.com/logins.php');
}
$find = $db->query('SELECT * FROM users WHERE username=\''.$user.'\'');
$finder = $db->fetch_assoc($find);
if($finder['password'] != $pass)
{
alert('Wrong username or password!');
redirect('http://www.rscheetah.com/logins.php');
}
else
{
setcookie("rscheetah_cookie", serialize(array($user, $pass)), time() + 31536000, '/', '', 0);
alert('Logged on successfully');
redirect('http://www.rscheetah.com/logins.php');
}
}
elseif($do == 'panel')
{
echo '<label class="main">Cant find act specified</label>';
}
?>
Thanks for your help though