hello
i use the fallowing code for my login page but it gives me the fallowing error i was wondering what is the problem? (line 179 is the setcookie)
by the way it doesn’t set the cookie
any help would be appreciated
error:
Warning: Cannot modify header information - headers already sent by (output started at /home2/sportsh9/public_html/test/login_acc.php:6) in /home2/sportsh9/public_html/test/login_acc.php on line 179
my code:
[php] <?
include_once(‘functions.php’);
function cleanQuery($string)
{
if(get_magic_quotes_gpc()) // prevents duplicate backslashes
{
$string = stripslashes($string);
}
$badWords = “(delete)|(update)|(union)|(insert)|(drop)|(http)|(–)”;
$string = eregi_replace($badWords, “”, $string);
if (phpversion() >= ‘4.3.0’)
{
$string = mysql_real_escape_string($string);
}
else
{
$string = mysql_escape_string($string);
}
return $string;
}
if (isset($_COOKIE[‘scmuser’])) {
echo “<META HTTP-EQUIV=“Refresh” CONTENT=“1; URL=index.php”>”;
}else{
if ($_POST[‘username’]) {
//did they supply a password and username
$username=cleanQuery($_POST[‘username’]);
$password=cleanQuery($_POST[‘password’]);
if ($password==NULL || $username==NULL) {
?>
Username or password wasn't supplied!
Username: | |
Password: | |
Register - Forgot Your Password? |
The supplied login was incorrect
Username: | |
Password: | |
Register - Forgot Your Password? |
thank you