Q:

Specifying ID in Mysqli query in php

I'm working on a CMS site, I've got blog posts that I store in a database. I can create, edit and delete them. There's an issue though when I want to edit them.
I can't specify the WHERE clause in the update query to match the id of the blog post I'm trying to edit!
Suppose I've got a blog post with an id of '5'.
If I write this code for it, it works exactly the way it should.
 $sqledit = "UPDATE paginas SET message='$_POST[message]' WHERE id= $_POST[id]";

But I don't want to edit just blog post #5, I want to edit the blog post that I'm updating. It seems to me this should work,
WHERE id= $_POST[id]";

... but it doesn't. 
That just throws me an undefined id error. But it shouldn't because I can delete blog posts the exact same way with this particular code:
$sqldel = "DELETE FROM `paginas` WHERE id= $_POST[id]"; 

This does allow me to.  
The code below is on the blog page, the edit query is in its own edit.php page
        if (isset($_POST['edit'])) // if pressed, execute

        {  
        echo

        '<br><br>  <div class="blogscript">
         <form action="edit.php" method="post">Edit your stuff<br>          
        <input type="text" placeholder='. $pagetitle . ' ><br><br>          
        <textarea id="message2" name="message">&lt;p&gt;' . $message . '&lt;/p&gt;</textarea><br>           
        <input type="submit" name="editsubmit" value="Confirm" />
        <input type="hidden" name="id" value="' . $id . '">.            </form></div>';
        }           

I look forward to any tips I should try out.
EDIT:
This is my edit.php page
<?php
  $DB_host = "localhost";
  $DB_user = "root";
  $DB_pass = "";
  $DB_name = "cmsbase";

  $MySQLi_CON = new MySQLi($DB_host,$DB_user,$DB_pass,$DB_name);

     if($MySQLi_CON->connect_errno)
     {
         die("ERROR : -> ".$MySQLi_CON->connect_error);
     }

     $sql = "UPDATE paginas SET message='$_POST[message]' WHERE id= $_POST[id]";

    if ($MySQLi_CON->query($sql) === TRUE) {
    echo "";
    } else {
    echo "Error: " . $sql . "<br>" . $MySQLi_CON->error;
    }
    $MySQLi_CON->close(); //close connection

    echo "<script>alert('Edited');location.href='index.php';</script>";

?>

EDIT: This is what the var_dump contains

A:

In order for values to be present in $_POST, you need to have some element (e.g. <input>, <select>, <textarea>) inside your form with a name attribute set to the $_POST key you want.
You can add a hidden input to your form for id.
<input type='hidden' name='id' value='" . $id . "'>

Assuming you are getting the $message variable shown in that form code by selecting from your database, you should be able to get the id from there as well, or potentially from your $_GET if that is how you determine which post is being displayed.

