Argh..I'm having a pain in the arse of a time with cookies! For some reason, including a file before creating a cookie is causing problems. At the moment I have;
And the error I KEEP getting is;
Warning: Cannot add header information - headers already sent by (output started at /home/ace-clipart.com/public_html/directory/cgi/banner/admin/settings.inc.php:43) in /home/ace-clipart.com/public_html/directory/cgi/banner/admin/admin.php on line 94
Warning: Cannot add header information - headers already sent by (output started at /home/ace-clipart.com/public_html/directory/cgi/banner/admin/settings.inc.php:43) in /home/ace-clipart.com/public_html/directory/cgi/banner/admin/admin.php on line 95
Note that line 94 and 95 are the setcookie() lines.
Any help you guys can offer would be much appreciated :
Thanks
Andy
Code:
function do_login() {
// require here...otherwise we get hassle from the cookie stuff :(
require_once("settings.inc.php");
global $login_username, $login_password, $admin_username, $admin_password;
if ($login_username == $admin_username && $login_password == $admin_password) {
setcookie(SETUSERNAME, $login_username);
setcookie(SETPASSWORD, $login_password);
// rerquire here...otherwise we get hassle from the cookie stuff :(
show_logged_in("0");
} else {
normal_error("The username/password combination you entered does not seem to be valid. Please check and try again.");
}
}
And the error I KEEP getting is;
Warning: Cannot add header information - headers already sent by (output started at /home/ace-clipart.com/public_html/directory/cgi/banner/admin/settings.inc.php:43) in /home/ace-clipart.com/public_html/directory/cgi/banner/admin/admin.php on line 94
Warning: Cannot add header information - headers already sent by (output started at /home/ace-clipart.com/public_html/directory/cgi/banner/admin/settings.inc.php:43) in /home/ace-clipart.com/public_html/directory/cgi/banner/admin/admin.php on line 95
Note that line 94 and 95 are the setcookie() lines.
Any help you guys can offer would be much appreciated :
Thanks
Andy