Hey, Im trying to make an login system, I made it so my form with username/password is on same page as I post info to.
problem I have now, my adres bar has: user=10&pass=10 in it.
and everytime I click on submit and password/username is correct I get a "Cannot add header information..."
Is there a Way i can get around this? I know its because I try to set cookie after I posted the user/pass info.
also when I do header, I get this problem can anybody help me?
here is some code:
if ((Isset($user)) && (Isset($pass))) {
$query = mysql_query("select username, password from user_test where username='$user'");
$result = mysql_fetch_array($query, MYSQL_ASSOC);
$active = $result["password"];
$coded = md5($pass);
if($active == $coded) {
setcookie('addict', '10', time() + 360024365);
setcookie('member', '$coded', time() + 360024365);
} else {
echo("Ooops, error in password/username");}}
if ((Isset($addict)) && (Isset($member))) {
echo("Welcome $addict");
} else {
include("login.inc"); }