How to check if ANY php parameter exists in url : <p>I am making a forum that accesses threads based off the category in the URL using the GET method. I want to redirect to an error page if no parameters exist in the url, but I want this to be a generic piece of code that can be used around my whole site.</p>

<p>For example:</p>

<p>The url would normally contain the category id:</p>

<pre><code>localhost/myforum/threads.php?categoryid=1
</code></pre>

<p>I want it so that when the url is:</p>

<pre><code>localhost/myforum/threads.php
</code></pre>

<p>it is to redirect to an error page, and that this piece of code is usable all around the website</p>
