如何判断用户是否已将表单的一部分留空

i have created a php page that allows users to enter different products in my database. I have set up different validations that work correctly but can not figure out how to tell if the user has left part of the form blank or the whole thing blank. They have three text boxes, on for the id, item, and cost. Does anyone know how I could go about seeing if each one of these text boxes are blank? Thanks

<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Adding Products</title>
    </head>
    <body>
        <?php
         $db_server = "server";
    $db_username = "name";
    $db_password = "pass";

       $con = mysql_connect($db_server, $db_username, $db_password);if (!$con)
                {
                    die('Could not connect: ' . mysql_error());
                }

               $database = "Product";  

              $er = mysql_select_db($db_username);
        if (!$er) 
        {
         print ("Error - Could not select the database");
         exit;
        }       

        $tbl_name ="Product";

        $ProductCode=$_POST['ProductCode'];
        $Description=$_POST['Description'];
        $Price=$_POST['Price']; 


            $ProductCode=mysql_real_escape_string($ProductCode);
            $Description=mysql_real_escape_string($Description);
            $Price=mysql_real_escape_string($Price);


             $status = "OK";

            if(strlen($ProductCode)>10)
            {
                echo('Your product code can only be a max of ten characters<BR>');
                $status= "NOTOK";
            }

            if(strlen($Description)>40)
            {
                echo('Your description of the product can only be 40 characters<BR>');
                $status ="NOTOK"; 
            }


            if(is_float($Price))
            {
                $english_format_number = number_format($Price); //Changing number to floating point
                //echo ('Your number must be in floating point.<BR>');
                //$status ="NOTOK";
            }

               if($status<>"OK")
               { 
                   echo('Some of your inputs were not in the correct format.<BR>');
               }
               else
               {
            $sql="INSERT INTO $tbl_name(Product_Code, Description, Price)VALUES('$ProductCode', '$Description', '$Price')";
            $result=mysql_query($sql);
            echo ('Your items have been inserted into the databae.');
               }



 ?>

You are probably looking for empty(). So basically what you need it something like this:

if (empty($_POST['field1']) || empty($_POST['field2'])) {
    // handle error
}
if (!empty($_POST['ProductCode'])) {
    $ProductCode = $_POST['ProductCode'];
} else {
    echo 'Please, fill in Product Code field';
}

empty() is what you are after, I think.

e.g.

if (empty($_POST['ProductCode'])) {
  // product code is empty
}

There is, however, one caveat to this: empty() considers '0' (a string containing a zero) to be empty. If this is a valid value for one of your fields, you would be better doing this:

if (!isset($_POST['ProductCode']) || trim($_POST['ProductCode']) === '') {
  // product code is empty
}
if(!isset($ProductCode) && empty($ProductCode))
        {
            echo('your message');
            $status= "NOTOK";
        }

        if(!isset($Description) && empty($Description))
        {
           echo('your message');
            $status ="NOTOK"; 
        }


        if(!isset($Price) && empty($Price))
        {
            echo('your message');

            //$status ="NOTOK";
        }

Edited: this may help