Hello All,
I am having trouble using the header function. I know that it needs to be outputted before any html, but my header I believe is correct, but still getting errors. Here is a snippet of what it looks like.
If ($submit)
{
If(!($link = mysql_connect(\"localhost\",\"user\",\"password\")))
{
ErrorString(\"Could Not Connect To Database\n\");
exit();
}
If(!(mysql_select_db(\"ccainc\")))
{
ErrorString(\"Could Not Select Database\\n\");
exit();
}
If ($news_id < 1)
{
$sql = \"insert into news values(\'\',\'$title\',\'$body\')\";
If(!($result = mysql_query($sql)))
{
ErrorString(\"Could Not Insert Article!\\n\");
exit();
}
}
else
{
$sql = \"update news set title=\'$title\', body=\'$body\' where news_id=$news_id\";
If(!($result = mysql_query($sql)))
{
ErrorString(\"Could Not Update Article!\\n\");
exit();
}
else
{
header(\"Location:http://linktosite/admin/News.php\");
exit();
}
} # End news_id < 1 If Statement
}
Does anyone have any suggestions?