# PHP - HOW TO make a form field REQUIRED

**URL:** <https://forum.kirupa.com/t/php-how-to-make-a-form-field-required/311270>\
**Category:** programming\
**Created:** [July 1, 2010, 5:11pm UTC](https://forum.kirupa.com/t/php-how-to-make-a-form-field-required/311270 "2010-07-01T17:11:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucobos](https://avatars.discourse-cdn.com/v4/letter/l/97f17d/32.png) [@lucobos](https://forum.kirupa.com/u/lucobos)\
**Post date:** [July 1, 2010, 5:11pm UTC](https://forum.kirupa.com/t/php-how-to-make-a-form-field-required/311270/1 "2010-07-01T17:11:37Z")

</div>

Hey you all. Very cool PHP tutorial, it all works great but i was wondering how to make required fields. I have been googling around for a while, i know it has to do with this line of code:

[COLOR=#0000ff](!($name && $email && $message))[/COLOR]  
[COLOR=#0000ff][/COLOR]  
[COLOR=black]But I don’t know where to place it in the kirupa sample. I would like the form to work in a way that if the user doesn’t fill out one required field he’ll be redirected to an html page that says something like: “missing information, go back to form… blah blah…”[/COLOR]

Any info, tip, advice is a life-saver and greatly appreciated.

Thanks a lot guys.
