PHP Form that checks if email is being used
<p>I have a simple form like so:</p>

<pre><code>&lt;fieldset id="membershipform"&gt; 

                        &lt;ul class="clearfix"&gt; 
                            &lt;li id="li-status"&gt; 
                                &lt;span&gt;I am a:&lt;/span&gt; 
                                &lt;menu&gt; 
                                    &lt;li&gt;&lt;label for="student"&gt;&lt;input disabled="disabled" type="radio" name="r1" id="student" checked="checked" /&gt; Graduate&lt;/label&gt;&lt;/li&gt; 
                                    &lt;li&gt;&lt;label for="student2"&gt;&lt;input disabled="disabled" type="radio" name="r1" id="student2" /&gt; Undergraduate&lt;/label&gt;&lt;/li&gt; 
                                &lt;/menu&gt; 
                            &lt;/li&gt; 
                            &lt;li id="li-firstname"&gt; 
                                &lt;label for="firstname"&gt;First Name&lt;/label&gt; &lt;input disabled="disabled" type="text" placeholder="First Name" id="firstname" title="First Name" /&gt; 
                            &lt;/li&gt; 
                            &lt;li id="li-lastname"&gt; 
                                &lt;label for="lastname"&gt;Last Name&lt;/label&gt; &lt;input disabled="disabled" type="text" placeholder="Last Name" id="lastname" title="Last Name" /&gt; 
                            &lt;/li&gt; 
                            &lt;li id="li-email"&gt; 
                                &lt;label for="email"&gt;Email address&lt;/label&gt; &lt;input disabled="disabled" type="text" placeholder="Email address" id="email" title="Email address" /&gt; 
                            &lt;/li&gt; 
                            &lt;li id="li-buttons"&gt; 
                                &lt;input type="submit" value="Send Application &amp;#9658;" title="Send Application" /&gt; 
                            &lt;/li&gt; 
                        &lt;/ui&gt; 

                    &lt;/fieldset&gt;
</code></pre>

<p>What I want this to do is post the contents of the form to a table in my database, but if the email address only exists in the DB I want it to throw an error saying 'email already in use' to prevent the same user from applying.</p>

<p>Thanks</p>

<p>EDIT: To clarify what my question is as some have commented below that they are unsure what I am asking. I'm looking for some examples of how I could check that an email address that is in table that is being posted to doesn't already exist and therefore would throw an error. Hope that makes sense. Thanks again.</p>
