by BandanaChaudhury » Tue Oct 16, 2012 6:59 am
<?php
include("common.php");
session_start();
$username = $_POST['username'];
$password = md5($_POST['password']);
if($username&&$password)
{
$connect = mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db("travelpoint") or die(mysql_error());
$query = mysql_query("SELECT * FROM register WHERE username='$username'");
$numrows = mysql_num_rows($query);
if($numrows!=0)
{
//code to login
while($row = mysql_fetch_assoc($query))
{
$dbusername = $row['username'];
$dbpassword = $row['password'];
}
//check to see if they match
if($username==$dbusername&&$password==$dbpassword)
{
header("location: member.php");
1 //echo"You're in! <a href='member.php'>Click</a> here to enter the memeber page!";
$_SESSION['username']=$username;
}
else
die("Incorrect Password!");
}
else
{
echo "That user doesn't exist!";
echo "You have to register first, click the link below";
echo "<a href='../../Travelpoint.com/register.php'><img src='../../images/Register.gif'></a>";
}
}
else
die("Please enter username and password");
?>
If i write it in the place of 1 then it is showing a error msg like
"Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\Travelpoint.com\common.php:199)"
What to modify, i am not getting it.