PHP Ver 7 - 未定义索引:吃 - 发布方法[重复]

I was making a simple form for getting data stored into variable.

My HTML Code:

<form class="form-horizontal" role="form" method="post" action="result.php">

    <div class="form-group">
      <label for="eat" class ="control-label col-md-3">Eating:</label>
        <div class="col-md-6">
            <input type="number" class="form-control" id="eating" placeholder="Hours Spent Eating Everyday">
        </div>
    </div> 
</form>

<div class="col-md-12">
<center><button type="submit" class="btn btn-default">Let's Know What You DID!</button></center>
</div>

MY PHP Code:

<?php 
$eat = $_POST["eating"];
?>

Error I'm Getting:

Notice: Undefined index: eating Notice: Undefined variable: eating Please help me out, I am using WAMP with Version 7 of PHP.

</div>

In html:

<input type="number" class="form-control" id="eating" placeholder="Hours Spent Eating Everyday" name="eating"> 

In php

If(isset($_POST["eating"])){
 $eating = $_POST["eating"];
}

Change this line

<input type="number" class="form-control" id="eating" placeholder="Hours Spent Eating Everyday">

to

<input type="number" class="form-control" name="eating" placeholder="Hours Spent Eating Everyday">

POST is referencing the name, not the ID.