send html form with php can't solve <p>I have big problem with sending easy html form with php. My problem is when all fields are empty it still send message. I don't why this code still send empty form??</p> <pre><code> &lt;form id="form1" name="form1" method="post" action="forma.php"&gt; &lt;p&gt; &lt;label for="ime"&gt;Ime:&lt;/label&gt; &lt;input type="text" name="ime" id="ime" /&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="prezime"&gt;Prezime:&lt;/label&gt; &lt;input type="text" name="prezime" id="prezime" /&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="email"&gt;e-mail:&lt;/label&gt; &lt;input type="text" name="email" id="email" /&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="poruka"&gt;Poruka:&lt;/label&gt; &lt;textarea name="poruka" cols="40" rows="10" id="poruka"&gt;&lt;/textarea&gt; &lt;/p&gt; &lt;p&gt; &lt;input type="submit" name="submit" value="submit" /&gt; &lt;/p&gt; &lt;/form&gt; </code></pre> <p>My php code:</p> <pre><code>&lt;?php if (isset($_POST['submit'])) { $ime= $_POST['ime']; $prezime= $_POST['prezime']; $email= $_POST['email']; $poruka= $_POST['poruka']; $email_from = 'neki@email.com'; $email_subject = "forma sa sajta"; $email_body = "Ime: $ime. \n". "Prezime: $prezime \n". "email: $email \n". "poruka: $poruka" ; $to = "myemail@gmail.com"; mail ($to, $email_subject, $email_body); echo "Message is sent"; } else { echo "Message is not sent"; } ?&gt; </code></pre> <p>So again, when i fill fields message is sent. It is ok, i received email. But when i just click submit (without filling fields) it still send message to my email.</p> <p>What is wrong with this code? I try everything i know, but without success. </p> <p>Thank you.</p>