when i used this script:
it would work fine, however i added it into a template and now it gives me the headers already sent. is there a different way or a way to fix this?PHP Code:<?php
$username = $_POST['username'];
$password = md5($_POST['password']);
mysql_connect("localhost", "ashin951_keydb", "***") or die(mysql_error());
mysql_select_db("ashin951_keydb") or die(mysql_error());
$query = "select * from officer where username='$username' and password='$password'";
$result = mysql_query($query);
if (mysql_num_rows($result) != 1) {
echo "Login failed. Please go back and try again.";
} else {
session_start();
$_SESSION['verify'] = "yes";
include('latestnews.php');
echo "<br><center><h2>Hello $username.</h2><br>";
echo "Please select your destination.<br><br>";
echo "<a href=\"approval.php\">Approval Section</a><br><br>";
echo "<a href=\"logservice.php\">Log Service Section</a><br><br>";
echo "<a href=\"logout.php\">Logout</a></center>";
}
?>

