aqeel
09-27-2010, 10:07 AM
Hi guys im using the following code query is executing n creating records in database but the page don't redirect to content.php. following is the code with the errir statement
<?php
$menuName = $_POST['menuName'];
$position = $_POST['position'];
$visibilty = $_POST['visibilty'];
$query = "INSERT INTO subjects(
menuName, position , visibilty
) VALUES(
'{$menuName}',{$position},{$visibilty}
)";
if(mysql_query($query, $conection)){
// succeded
//echo "Subject creation successful";
header("Location: content.php");
exit;
}else{
// failed
echo "<p>Subject creation failed</p>" ;
echo "<p>". mysql_error() ."</p>";
}
?>
The error stament is
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\widget\creat_subject.php
<?php
$menuName = $_POST['menuName'];
$position = $_POST['position'];
$visibilty = $_POST['visibilty'];
$query = "INSERT INTO subjects(
menuName, position , visibilty
) VALUES(
'{$menuName}',{$position},{$visibilty}
)";
if(mysql_query($query, $conection)){
// succeded
//echo "Subject creation successful";
header("Location: content.php");
exit;
}else{
// failed
echo "<p>Subject creation failed</p>" ;
echo "<p>". mysql_error() ."</p>";
}
?>
The error stament is
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\widget\creat_subject.php