Best way to structure this PHP code
You can combine the conditions. It's invalid if both are set: $_REQUEST['b_id'] &amp;&amp; $_REQUEST['s_id'] OR if neither are set: !$_REQUEST['b_id'] &amp;&amp; !$_REQUEST['s_id']. The intermediary variables are unnecessary.

Additionally, the &lt;center&gt; tag has been deprecated for some 20 years now and the use of inline styles is discouraged. You should make the element a &lt;div&gt; with a class and set the style in CSS, including a text-align: center; rule to get the same effect.

if( ($_REQUEST['b_id'] &amp;&amp; $_REQUEST['s_id']) || (!$_REQUEST['b_id'] &amp;&amp; !$_REQUEST['s_id']) ) {
    die('&lt;div class="errormessage"&gt;Not A Valid Request URL&lt;/div&gt;');
}