i get a post values from form which contain subject name ,position,visible and then insert as an new row value is inserted correctly but i want to redirect to content.php page from create_subject.php back to my content.php when i use header("Location: content.php");
it gives me this error when i fill form and hit submit error is "Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\widget_corp\includes\connection.php:1) in C:\xampp\htdocs\widget_corp\create_subject.php on line 14" then when i again open content.php then it sucessfully show the new entry which i added my code is
Code: Select all
$menu_name= $_POST['menu_name'];
$position = $_POST['position'];
$visible = $_POST['visible'];
$query = "INSERT INTO subjects (
menu_name, position, visible)
Values ( '{$menu_name}',{$position},{$visible})";
if(mysql_query($query,$connection)){
header("Location: content.php");
exit;
}else {
echo "<p> Subject creation is failed .</p>";
echo "<p>".mysql_error()."</p>";
}help me pleaseeeeeeeeee i m stucked from last 2 days