detect click on submit button in PHP
<p>I have a php file that contains a form (witch contains 2 input boxes and a submit button) for updating a contact. I managed to fill the fields with the contact's data, but I can't detect if the submit button is clicked</p>

<p>form looks like this</p>

<pre><code>echo "&lt;form action=Contact.php&gt;&lt;table&gt;".
"&lt;tr&gt;&lt;td&gt;First Name&lt;/td&gt;&lt;td&gt;&lt;input type=text size=75% name=FirstName value='".$row['FirstName']."'&gt;&lt;/td&gt;&lt;/tr&gt;".
"&lt;tr&gt;&lt;td&gt;Last Name&lt;/td&gt;&lt;td&gt;&lt;input type=text size=75% name=LastName value='".$row['LastName']."'&gt;&lt;/td&gt;&lt;/tr&gt;".
"&lt;tr&gt;&lt;td colspan=2&gt;&lt;input type=submit name=UpdateContact value=Update&gt;&lt;/td&gt;&lt;/tr&gt;".
"&lt;/table&gt;&lt;/form&gt;";
</code></pre>

<p>this code should output a "clicked" message if the button is clicked</p>

<pre><code>if (isset($_POST['UpdateContact']))
{
   echo "&lt;p&gt;clicked";
}
else
{
   echo "&lt;p&gt;not clicked";
}
</code></pre>

<p>can anyone help me out or tell me what i've done wrong</p>

<p>(I want from the same php file to fill the contact's data in a from and to update the database)</p>
