Checking user input
<p>I'm creating an edit page which should get called this way:</p>

<pre><code>users.php?action=edit&amp;id=5
</code></pre>

<p>This is my code for this:</p>

<pre><code>} elseif (isset($_GET['action']) &amp;&amp; $_GET['action'] == 'edit' &amp;&amp; isset($_GET['id']) &amp;&amp; is_numeric($_GET['id']) &amp;&amp; $_GET['id'] &gt; 0) {
</code></pre>

<p>As you see it's long. First a check with isset is needed. I know you can leave that out, but that way I'll get PHP notices when error reporting is set to 'E_ALL'.</p>

<p>I can create a function to make it shorter but that way I'll need to create too many functions as I have such code on different places in my scripts, each requiring different information.</p>

<p>Is there any way to make this code shorter?</p>

<p>Thanks!</p>
