prepare($post_sql);
$stmt->bind_param('i', $_GET['post']);
$stmt->execute();
$post_result = $stmt->get_result();
if(!$post_result)
{
echo 'The post could not be retrieved, please try again later.';
}
else
{
if($_SERVER['REQUEST_METHOD'] != 'POST')
{
$post_result = $post_result->fetch_assoc();
if(!$_SESSION['signedIn'])
{
echo 'You must be signed in to edit a post. You can also sign up for an account.';
}
else if ($_SESSION['userNo'] != $post_result['postBy'])
{
echo 'You cannot edit this post. You are not OP!';
}
else
{
$content = htmlentities(stripslashes($post_result['postContent']));
//show edit form
echo '