forms - Radio Button INPUT not sending the input to the PHP code -


the code given below shows errors :

<div class="field form-inline radio"> <form method="post" action=""> <div> <label><input type="radio" name="eatable" value="fruit_in"/> fruit</label> </div>   <div> <label><input type="radio" name="eatable" value="vegetable_in"/> vegetable</label> </div>   <div> <label><input type="radio" name="eatable" value="bread_in"/> bread</label> </div>   <div> <label><input type="radio" name="eatable" value="milk_in"/> milk</label> </div> </form> <?php  $veg = $_post['eatable']?> 

please can tell problem in code ? error says : notice: undefined index: eatable in c:\xampp\htdocs\k\upload.php on line 250

notice: undefined index caused, due $_post doesn't have index eatable, form not yet posted.

you can like:

<?php if(isset($_post['eatable'])){ $veg = $_post['eatable']; } ?> 

Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -