Best way to structure this PHP code I have this PHP code. I wrote it for a webpage it uses parameters. Only one set of parameters can be set at any one time. If both are set its invalid, if None are set its invalid

How would be the best way to write it, looks too long to me and i Feel like I have complicated it

if($_REQUEST['b_id'] &amp;&amp; $_REQUEST['s_id']) {
        die('&lt;center style="color: #000; background-color: #FFF; height:100vh; font-size: 4vw;"&gt;Not A Valid Request URL&lt;/center&gt;');
}
if(!$_REQUEST['b_id']) {
        $b = false;
} else {
        $b = true;
}

if(!$_REQUEST['s_id']){
           $s = false;
} else {
           $s = true;
}

if($b === $s) {
        die('&lt;center style="color: #000; background-color: #FFF; height:100vh; font-size: 4vw;"&gt;Not A Valid Request URL&lt;/center&gt;');
} else if($_REQUEST['b_id'] == $_REQUEST['s_id']) {
      die('&lt;center style="color: #000; background-color: #FFF; height:100vh; font-size: 4vw;"&gt;Not A Valid Request URL&lt;/center&gt;');
}


PS the code works as expected. I just need help making it neater little less confusing.
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;');
}