anyone can help me with this error what does it do?
im working on with my LOGIN script, and when i tried to run the script.
what does it mean? anyone, thanks!:)


Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\MEA\connect.php:7) in C:\xampp\htdocs\MEA\testlog.php on line 18

It means your script already outputted something, before you called the header function. It can be an echo, or some dangling whitespace in your code.

sir can you take a look whats wrong with my code? it doesn't redirect, i only got this error ...


Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\MEA\connect.php:7) in C:\xampp\htdocs\MEA\testlog.php on line 16

<?php
                    session_start();
					include_once("connect.php");
					if(isset($_POST['submit']))
					{
					$idno=$_POST[idno];
					$pass=$_POST[pass];
			$login=mysql_query("Select * from register where idno='$idno' and password='$pass'")or die (mysql_error());
			
				if(mysql_num_rows($login)==0)
				{
					$msg="invalid";
				}
					else {
					$_SESSION[idno]=$idno;
					header("location:adminpage.php");
					}
					}
					?>
<!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>Untitled Document</title>
</head>

<body>

<form action="testlog.php" method="post">

idno<input name="idno" type="text" />
pass<input name="pass" type="text" />

<input name="submit" type="submit" />
</form>
</body>
</html>

Make sure there is nothing before <?php

no there isn't i removed the space in line 1.. and still with the same error sir..

How about in connect.php ?

this is my connect script sir,

<!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>Untitled Document</title>
</head>

	<?php
$host="$localhost";
$username="root";
$pwd="";
$db_name="mea";

	$connect=mysql_connect($host,$username,$pwd) or die("unable to connect!");
	mysql_select_db($db_name);
?>
<body>
</body>
</html>

You should remove all HTML from that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.