Hi Expertz!!
I m fairly new in PHP and Mysql.
I m facing following doubts while begining. Plz help me get out of this Probs:
i make Simple login form and want only Authonticate user will do log in and after login i want to redirect on next page.
Script is:
<?php include_once("connect_server.php");
/*if ($name != "" and $password != "")
{
$query="select user_name,pword from admin_account where user_name='" .$name. "' and pword='" .$password. "'";
$result=mysql_query($query, $con) or die(mysql_error());
echo '<form action="">';
}
else
{
echo "User Name and Password Does not exist";
}
echo "</form>"; */
$user=$_POST['name'];
$pass=$_POST['password'];
if (empty($user))
{
$message="Please enter a Name!";
echo "$message";
}
else if (empty($pass))
{
$message="Please enter a password!";
echo "$message";
}
else if (!empty($user) && (!empty($pass)))
{
$query="select user_name,pword from admin_account where user_name='". $user ."' and pword='". $pass ."'";
$result=mysql_query($query, $con) or die(mysql_error());
header("Location: index.php"); //// Here i want to redirect next page
}
mysql_close($con);
?>
The above mentioned code showing me Following Error while using Header:
Warning: Cannot add header information - headers already sent by (output started at c:\inetpub\wwwroot\handshake\admin.php:17) in c:\inetpub\wwwroot\handshake\admin.php on line 104
Plz plz help me!
Eargly waiting 4 ur Reply!
THANKS