could someone please help me solve the following code error thanks
<?php
//create_cat.php
include 'mysql.php';
include 'header.php';
if($_SERVER['REQUEST_METHOD'] != 'POST')
{
//someone is calling the file directly, which we don't want
echo 'This file cannot be called directly.';
else
{
//check for sign in status
if(!$_SESSION['loggedIn'])
{
echo 'You must be signed in to post a reply.'. mysql_error();
}
else
{
//a real user posted a real reply
$topicid = mysql_insert_id();
$sql = "INSERT INTO
post(content,
date,
topic,
postby)
VALUES
('" . mysql_real_escape_string($_POST['content']) . "',
NOW(),
" . $topicid . ",
" . mysql_real_escape_string($_GET['id']) . ",
" . $_SESSION['user_id'] . ")";
$result = mysql_query($sql);
if(!$result)
{
echo 'Your reply has not been saved, please try again later.'. mysql_error();
}
else
{
echo 'Your reply has been saved, check out <a href="topic.php?id=' . htmlentities($_GET['id']) . '">the topic</a>.';
}
}
}
}
include 'footer.php';
?>