Ive coded a login / logout section for my registration system, and even to drop the account..
Ive figured out cookies were messing up with my CSS style sheet (the header error)
Warning: Cannot add header information - headers already sent by (output started at /home/thehard/public_html/workin/login.php:20) in /home/thehard/public_html/workin/login.php on line 38
Login was successful!, Your now being taken back to the main page.
So ive tooken out the <link rel="stylesheet" href="<? echo "$css" ?>"> and <title> & <head> commands
Now I just had a blank page with the mysql code and it worked fine, but I tried to make the page appear nicer (then a blank page) and I get that error again... But im not using any other headers! I dont think...
Here is what Im using
<?
require("header.php");
?>
<body bgcolor="black" text="white">
<table width="100%" cellpadding="10" cellspacing="0" border="0">
<tr>
<td width="20%" valign="top">
<center><img src="mGeneral.jpg" alt="[TheHardyZ.com]"></center>
</td>
<td width="80%" valign="top">
<center><img src="phpbanner.jpg" alt="[TheHardyZ.com]"></center>
</td>
</tr>
<tr>
<td width="100%" colspan="2">
<br><br><br><br><br><center>
<?
if ((!$username) || (!$password)) {
echo "Please fill in all fields";
return;
}
else {
mysql_connect($thc->server, $thc->db_user, $thc->db_pass);
mysql_select_db($thc->database);
$query = mysql_query("SELECT * from users WHERE username='$username' AND password='$password'");
$result = mysql_num_rows($query);
mysql_close();
if ($result < 1) {
echo "<b><font color='#OOFBB1' face='Verdana'>WARNING:</font></b> Login has <b><font color='#OOFBB1'>failed</font></b> ... Possible reasons are invalid username or password.<br>Please remember both are case sensitive!<br><br>If you feel you have entered the correct password, you might try <a href='lostpass.php'><font color='#OOFBB1'>clicking here</font></a>";
return;
}
else {
setcookie("TheHardyZcom","$username",time()+604800);
echo "Login was <b><font color='#OOFBB1' face='Verdana'>successful!</font></b>, Your now being taken back to the main page.";
}
}
?>
<META HTTP-EQUIV="Refresh" CONTENT="3; URL=http://www.thehardyz.com/workin">
Once I added in the <body> command and the <font> commands ive seem to of got this error again .....
Any help would be appreciated .. Ive been stuck for 3-4 days 🙁