Page 1 of 1

Problem Help Please 2 | PHP2

Posted: Tue Mar 16, 2010 11:18 pm
by sazzadraju
<?php include("dbconnection.php");?>


<?php


$login = $_POST['login'];
$pass = $_POST['pass'];

$query = mysql_query ("SELECT * FROM users WHERE login = '$login' and pass = '$pass'");
if (mysql_num_rows ($query) > 0 )
{
session_start ();
$_SESSION['login'] = $login;
print "<script>";
print " self.location='order_list.php';";
print "</script>";


}
else {
print "<script>";
print " self.location='admin-login.html';";
print "</script>";
}
?>


when i try to login its show message like this

Cannot add header information - headers already sent by (output started at /var/www/.........../check.php:2)in home/..../......../check.php on line 14


after a few moment login become successful....

Re: Problem Help Please 2 | PHP2

Posted: Wed Mar 17, 2010 8:29 pm
by JakeJ
It would help if we knew which line was line 14.

Also, it's completely unnecessary for you to enclose your dbconnetion string in a separate php statement unless you have some html code that goes in between that you are not quoting.