Jump to content

Cannot modify header information - headers already sent by (output start


alvin567

Recommended Posts


<!--
   login functions
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<?php 
    include 'mysql_config.php';
include 'mysql_opendb.php';
?>
<html>
<body>
	<form id="login" action="login.php" method="post">
		Email: <input type="text" name="email"/>
		</br>
		Password:<input type="password" name="password" maxlength="12"/>
		</br>
		<input type="submit" value="submit">
	</form>
</body>
<html>

<!--login controller-->
<?php 
    if(isset($_POST['email']) && isset($_POST['password'])){
    //$email =htmlspecialchars($_POST['email'],ENT_QUOTES);//special character in email
$email = $_POST['email'];
$password = $_POST['password'];
//on alternate flow 3a) password and user id not founded.
    if( $email != "" || $password != ""){
	$sql="SELECT * FROM user WHERE email='".$email."'";
	$result=mysql_query($sql);
	$row=mysql_fetch_array($result);
	if($password == $row['password']){
		header('Location: home.php');//the pages for the members dashboard,set the type of preference.
		//need to sessions to set the type of users
	}
	else{
		echo 'Password not founded.Contact PanelPlace SuperAdmin';
	}
}else{
	echo 'Please fill in the username and password';
}
}
?>
<?php 
include 'mysql_closedb.php';
?>

 

Currently working on a login functions,it output the errors as follows in the sites.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.