Headers already sent refers to HTTP Headers.
The server cannot send any more http headers if the HTTP Content has started sending.
In PHP code, this means you have ouput something to the page with echo or print etc.
PHP will not output any whitespace in between php tags, However, for anything outside php tags, (eg: html) whitespaces, linebreaks are sent as HTTP Content.
Sometimes this your editor may add whitespace also.
To prevent whitespace from being sent before you send all your headers, make sure the <?php is right at the top of the php script, and there are no lines or white space in between.
You can also use output buffering, ob_start() to buffer your PHP output before sending it to HTTP. Then use ob_flush() to send http output when you need.
see: http://www.php.net/manual/en/function.ob-start.php
I noticed you have //header("Location:admin_page.php"); in your page. You can use the output buffering to allow you to send this header even after you have echo and html output in your php.

<?php
}
else {
$query = "SELECT * from users WHERE firstname='$f_name' and lastname='$l_name' and password='$pass' ";
$result = mysql_query($query);
for ($i = 0; $i < mysql_num_rows($result); $i++)
{
$id = mysql_result($result, $i, "id");
$fname = mysql_result($result, $i, "firstname");
$lname = mysql_result($result, $i, "lastname");
$pas = mysql_result($result, $i, "password");
if (("$f_name" == "$fname") and ("$l_name" == "$lname") and ("$pass" == "$pas"))
{
$_SESSION['sfname'] = $f_name;
$_SESSION['slname'] = $l_name;
echo "";
exit;
}//if loop
}//for loop
echo "";
//header("Location:new_user.php");
exit;
}
?>