I created a script but when I view the page, it is giving me the following warning:
Warning: Cannot send session cache limiter - headers already sent (output started at /home/admin/public_html/cms/global.php:5) in /home/admin/public_html/cms/index.php on line 5.
The first part of Global.php looks like:
<?php
function cms_header()
{
?>
<style type="text/css">
<!--
.cmsstyles
-->
</style>
<title>CMS</title><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center"><img src="images/cms.jpg" width="242" height="43"></div></td>
</tr>
</table>
And the first part index.php looks like:
<?php
require("global.php");
cms_header();
session_start();
if (isset($HTTP_POST_VARS['userid']) && isset($HTTP_POST_VARS['password']))
{
// if the user has just tried to log in
$userid = $HTTP_POST_VARS['userid'];
$password = $HTTP_POST_VARS['password'];
$db_conn = mysql_connect('localhost', 'username', 'password');
mysql_select_db('cms', $db_conn);
$query = 'select * from auth '
."where name='$userid' "
." and pass=password('$password')";
$result = mysql_query($query, $db_conn);
if (mysql_num_rows($result) >0 )
{
// if they are in the database register the user id
$HTTP_SESSION_VARS['valid_user'] = $userid;
}
}
?>
<?
if (isset($HTTP_SESSION_VARS['valid_user']))
{
?>
Any ideas as to why the warning?
Thanks