Ive uploaded a site to my server.
I have a very simple login form for the owner to lofg in and update content.
But I am getting this error.
'Warning: Cannot modify header information - headers already sent by (output started at /websites/123reg/LinuxPackage22/re/pt/il/reptile-ni.co.uk/public_html/php/login.php:3) in /websites/123reg/LinuxPackage22/re/pt/il/reptile-ni.co.uk/public_html/php/login.php on line 28'
Here the code.
?php
include 'connect.php';
if (isset($_POST['submit'])){
if (!empty($_REQUEST['user'])){
$auser = $_REQUEST['user'];
}
else{
$auser = NULL;
echo 'Enter username';
echo "<br />";
}
if (!empty($_REQUEST['pass'])){
$apass = $_REQUEST['pass'];
}
else{
$pass = NULL;
echo 'Enter password';
}
if ($auser && $apass){
if (isset($_POST['submit'])){
$data = mysql_query("SELECT * FROM reptile_admin");
while($info = mysql_fetch_array( $data )){
if($auser == $info['username'] && $apass == $info['password']){
header( 'Location: admin.php' ) ;
}
else{
echo "<span class='span1'>";
echo 'Wrong password and(or) username. Check and try again';
echo"</span>";
}
}
}
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Admin login</title>
<link href="../css/submit.css" rel="stylesheet" type="text/css" />
<link href="../css/template.css" rel="stylesheet" type="text/css" />
<body>
<img alt="full screen background image" src="../images/background.jpg" id="full-screen-background-image" />
<a href='../php/index.php'><span class="adminlinks">Home</span></a>
<form class="form" action="login.php" method="post" enctype="multipart/form-data" name="login_form" id="login_form" style="margin-bottom:0px;">
<h1 style="margin-bottom: 0px">Admin Login</h1>
<p><input type=text name="user" /> <b>User Name</b></p>
<p><input type=text name="pass" /> <b>Password</b></p>
<input type="submit" name="submit" value="Login" />
<input name="login_form" type="hidden" id="login_form" value="login_form" />
</form>
</body>
</html>
Can anyone tell me whats wrong??
Thanks for looking....................