Hi all,
In my .php file, I'm using both session_start() and setcookie() before
<html> tag. It gives me following warning message:
Warning: Cannot modify header information - headers already sent by
(output started at D:\Apache Group\Apache2\h tdocs\YC\songs. php:4) in
D:\Apache Group\Apache2\h tdocs\YC\ycphpf unc.php on line 148
My .php file looks like this:
<?php session_start() ; ?>
<?php
ob_start();
include 'ycphpfunc.php' ;
$login = new login_class;
if ($_POST[logusername] == "" || $_POST[logpassword] == "") {}
else {
$login->check_login($_ POST['logusername'], $_POST['logpassword'],
$_POST['remember']);
}
ob_end_flush();
?>
<html>
........
........
</html>
The call to check_login()ca lls setcookie() function through another
function inside my "ycphpfunc. php" file.
Can someone show me a way to include both session_start() and
setcookie() before <html>?
Thanks for your time!
Ben
In my .php file, I'm using both session_start() and setcookie() before
<html> tag. It gives me following warning message:
Warning: Cannot modify header information - headers already sent by
(output started at D:\Apache Group\Apache2\h tdocs\YC\songs. php:4) in
D:\Apache Group\Apache2\h tdocs\YC\ycphpf unc.php on line 148
My .php file looks like this:
<?php session_start() ; ?>
<?php
ob_start();
include 'ycphpfunc.php' ;
$login = new login_class;
if ($_POST[logusername] == "" || $_POST[logpassword] == "") {}
else {
$login->check_login($_ POST['logusername'], $_POST['logpassword'],
$_POST['remember']);
}
ob_end_flush();
?>
<html>
........
........
</html>
The call to check_login()ca lls setcookie() function through another
function inside my "ycphpfunc. php" file.
Can someone show me a way to include both session_start() and
setcookie() before <html>?
Thanks for your time!
Ben
Comment