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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.