hi i am new to php. i am getting the following error.
------Cannot modify header information - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\login\login.php:23)-----------
<html>
<body>
<form action="login.php" method="post">
<div>
<table width="100%">
<tr>
<td><img src="Logofinalcopy.gif"></td>
</tr>
<tr>
<td bgcolor="aqua"><h2>Login</h2></td>
</tr></table>
<table align="right" style="width:40%">
<br>
<tr>
<td>username:</td>
<td><input type="text" name="username"></td>
</tr>
<tr>
<td>password:</td>
<td><input type="password" name="password"></td>
</tr>
<tr>
<td align="CENTER" COLSPAN="4">
<input TYPE="SUBMIT" name="submit" value="Login">
<input TYPE="reset" name="submit" value="clear"></td>
</tr>
</table>
</div>
</form>
</body>
</html>
<?php
if(isset($_POST['submit']))
{
$con = mysql_connect("10.70.1.50","invensis","invensis");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$con= mysql_select_db("Login",$con);
if (!$con)
{
die('Could not connect DB: ' . mysql_error());
}
$sql="SELECT * FROM users WHERE username='invensis' AND password='invensis'";
$result=mysql_query($sql);
$count= mysql_num_rows($result);
echo $count;
if($count==1)
{
$sql = mysql_query("SELECT role FROM users WHERE username='invensis' AND password='invensis'");
while($info = mysql_fetch_array($sql))
{
if($info['role']=='0')
{
header('location: [url]http://localhost//login/test.php');[/url]
}
else
{
echo 'null';
}
}
}
}