954,597 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

lOGIN problem! need help!

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

lastgame2007
Light Poster
27 posts since Jul 2011
Reputation Points: 7
Solved Threads: 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.

pritaeas
Posting Expert
Moderator
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

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>
lastgame2007
Light Poster
27 posts since Jul 2011
Reputation Points: 7
Solved Threads: 0
 

Make sure there is nothing before <?php

pritaeas
Posting Expert
Moderator
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

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

lastgame2007
Light Poster
27 posts since Jul 2011
Reputation Points: 7
Solved Threads: 0
 

How about in connect.php ?

pritaeas
Posting Expert
Moderator
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

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>
lastgame2007
Light Poster
27 posts since Jul 2011
Reputation Points: 7
Solved Threads: 0
 

You should remove all HTML from that.

pritaeas
Posting Expert
Moderator
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: