session_start();
if (!session_is_registered("LLC"))
{
// if session check fails, invoke error handler
header("Location: ../loginform.php");
exit();
}
$user = $_SESSION['UNAME'];
$Language = trim($_POST['language']);
$Title = trim($_POST['title']);
$Description = $_POST['description'];
$Header = trim($_POST['header']);
$Link = trim($_POST['link']);
if ($Title == '')
{
print "
You must enter the title. Please go back and try again.
";
exit();
}
$title = addslashes($Title);
$description = addslashes($Description);
$header = addslashes($Header);
$link = addslashes($Link);
include("../include/dbconfig.php");
$connection = mysql_connect($db_host, $db_user, $db_pass) or die ("Unable to connect!");
mysql_select_db($db_name);
$query = "insert into MM_titles set Language='$Language', Title='$title', Description='$description', URL_header='$header', DirectLink='$link'";
$result = mysql_query($query, $connection) or die ("Error in query: $query. " . mysql_error());
header("Location: addtitle.php?language=$Language");
exit();
?>