Hi
I have a index.php page need to include a login.php page as many php pages needs to use the same login interface and code.
Here is the code:
<?php
session_start();
?>
<html>
<head>
<title>test</title>
<META http-equiv=Content-Type content="text/html; charset=utf8">
<META NAME="description" CONTENT="test">
<META NAME="keywords" CONTENT="test">
<link href="style.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="g.js"></script>
</head>
<body>
<table width="100"><?php ob_start(); include 'login.php'; ob_end_flush();?><tr>
Here is the warning message:
Cannot modify header information - headers already sent by (output started at /home/www/index.php:11) in /home/www/login.php on line 16
I read:
http://codex.wordpress.org/FAQ_Troubleshooting#How_do_I_solve_the_Headers_already_sent_warning_problem.3F
http://www.webmasterworld.com/php/3519848.htm
http://us2.php.net/ob-start
I tried all methods. After I login, that error message would be shown.
However, I cannot place the login.php's code on the top of all php pages (before <html> tage) which need it.
How should I fix it now?
Thanks for any advice.