try this, not sure if it'll work, but i rewrote some of it
PHP Code:
<html>
<head><title>Add News</title></head>
<body>
<?php
$form = "<form action=\"$PHP_SELF\" method\"post\">";
$form .= "<b>Title</b>";
$form .= "<input type=\"text\" name=\"title\" size=\"50\" value=\"\"><br />";
$form .= "Content:<br /> <textarea name=\"content\" cols =\"45\" rows=\"4\"></textarea><br />";
$form .= "<input type=\"submit\" name=\"submit\" value =\"submit\"></form>";
if (!$_POST['submit']) {
$msg = $form;
} else if (empty($_POST['title']) or empty($_POST['content'])) {
$msg = '<b>Please complete all fields</b><br /><br />';
$msg .= $form;
} else if ($_POST['submit'] and $_POST['content'] and $_POST['title']) {
$conn = @msql_connect("localhost","root","mist") or die("Could not connect to db");
$rs = @mysql_select_db("designdevise",$conn) or die ("Could not select db");
$sql = "insert into news (title,content) values (\"$title\",\"$content\")";
$query = @mysql_query($sql,$conn) or die("Could not execute query");
if($query)
{
$msg = "News added";
}
}
echo($msg);
?>
</body>
</html>