You must use:if (isset($_POST['id']))Instead of:if ($id)For more information, please read this post! Note: When submiting data via form, you must use $_GET / $_POST, depending on your form method. Otherwise use $_GET or $_REQUEST!