Check if a characters occurs once in URL
<p><strong>My Question</strong></p>

<p>I want to check if the URL contains one <code>?</code> if true, <code>do something</code></p>

<p><strong>My PHP</strong></p>

<p>Im using this script currently. </p>

<pre><code>$lp_uri = $_SERVER['REQUEST_URI']; // or taken from another source //
    if( strpos($lp_uri, '?') !== false ){
    echo '&lt;script&gt;alert("one question mark");&lt;/script&gt;';
}
</code></pre>

<p><strong>My Issue</strong></p>

<p>Im not sure how to check if the<code>?</code> occurs <strong>once only</strong>. Can you please help? Thanks heaps</p>

<p><strong>The reason</strong></p>

<p>I have a contact form on my website and once someone submits it, it addds a parameter to the url so it look like <code>website.com?msgsent=1</code>. This means the message has been send. But sometimes if the <code>email</code> field is incorrect, it still adds a <code>?</code> to the url so the url looks like <code>website.com?</code>.</p>

<p>Now, I am using a jQuery <code>slideDown</code> delay on my contact form to grab customers attention and everytime the page refreshes, it takes few seconds to <code>slideDown</code>. I want to overcome this if the url has a <code>?</code> in it because if the url looks <code>website.com?</code> that means, the email address is wrong. </p>

<p>Hope this makes sense. </p>
