Warning: Header may not contain more than a single header, new line detected in C:\xa

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hanspeare
    New Member
    • May 2014
    • 20

    #1

    Warning: Header may not contain more than a single header, new line detected in C:\xa

    Hi there,

    i have recieved this notice

    Warning: Header may not contain more than a single header, new line detected in C:\xampp\htdocs \a\Student_Edit _Handler.php on line 53

    and these are my codes. Kindly help me to fix this.
    Code:
    <?php
    	session_start();
    	$session_id = $_SESSION['user_id'];
    	if($session_id == null){
    	   header("location:Student_Edit.php");
    	   die();
    	}
    	include 'Connect.php';
    	$flag = "success";
    	function rollbackData(){
    		mysql_query(" ROLLBACK ");
    		global $flag; 
    		$flag = "error";
    		if(mysql_error() != null){
    			die(mysql_error());
    		}
    	}
    	$student_id = $_POST['student_id'];
    	$first_name = $_POST['first_name'];
    	$last_name = $_POST['last_name'];
    	$gender = $_POST['gender'];
    	$date_of_birth = date("Y-m-d",strtotime($_POST['date_of_birth']));
    	$contact_no = $_POST['contact_no'];
    	$grade = $_POST['grade'];
    	$section = $_POST['section'];
    	$LRN = $_POST['LRN'];
    	$email1 = $_POST['email1'];
    	$email2 = $_POST['email2'];
    	$address = $_POST['address'];
    	$description = $_POST['description'];
    	$imagename = "";
    	$flag= "";
    		mysql_query("SET AUTOCOMMIT = 0 ");
    		if(mysql_error() != null){
    			die(mysql_error());
    		}
    	$query = "UPDATE student_information SET first_name='$first_name',last_name='$last_name',";    
    	$query .= "gender='$gender',date_of_birth='$date_of_birth',contact_no='$contact_no',grade='$grade',section='$section',";
    	$query .= "LRN='$LRN',email1='$email1',email2='$email2',address='$address',description='$description'";     
    	$query .= " WHERE student_id='{$_SESSION['user_id']}'";      
    	$result = mysql_query($query, $link_id);
    	if(mysql_error() != null){
    		die(mysql_error());
    	}
    	if($result)
    	{ 
    		$flag = "success";
    	}
        else
    	{
    		 $flag = "error"; 
      	}
    	header("location:Student_Edit.php?flag=$flag&student_id=student_id=$student_id");
    ?>
    Please advise
  • Exequiel
    Contributor
    • Jul 2012
    • 288

    #2
    try to put this code after your session_start() ;
    ob_start();

    Comment

    Working...