0

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

2
Contributors
7
Replies
8
Views
5 Years
Discussion Span
Last Post by pritaeas
0

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.

0

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>
0

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>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.