无法将数据发送到数据库,重定向无法正常工作

When you hit the "Post" button it should send the data to the database and redirect you to ?success=true but it will not redirect you or send the data to the DB.

This is suppose to do the redirecting and function calling:

if (empty($_POST['postBox']) === false && $_GET['success'] != true){
    sendPost();
    header("LOCATION: /offtopic.php?success=true");
    exit();
}

This is sendPost:

function sendPost()
{
    $postBox = '\'' . htmlentities(mysql_real_escape_string($_POST['postBox'])) . '\'';
    $user_id = $_SESSION['user_id'];
    mysql_query("INSERT INTO `offtopicposts` (user_id, post, reported) VALUES ($user_id, $postBox, 0)") or die(mysql_error());
}

EDIT: You can log in to the off-topic page with the username: Test and password: Test123456789

Try this if condition

if (!empty($_POST['postBox']) && $_GET['success'] != 'true')

put a return statement in function

function sendPost()
{
    $postBox = '\'' . htmlentities(mysql_real_escape_string($_POST['postBox'])) . '\'';
    $user_id = $_SESSION['user_id'];
    mysql_query("INSERT INTO `offtopicposts` (user_id, post, reported) VALUES ($user_id, $postBox, 0)") or die(mysql_error());
   return;
}

I am so sorry... Because of the new background I was unable to see the error... In the DB something wasn't allowed to be null... So a quick fix and its working... Thank you all for the help!