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'] && $_REQUEST['s_id']) {
die('<center style="color: #000; background-color: #FFF; height:100vh; font-size: 4vw;">Not A Valid Request URL</center>');
}
if(!$_REQUEST['b_id']) {
$b = false;
} else {
$b = true;
}
if(!$_REQUEST['s_id']){
$s = false;
} else {
$s = true;
}
if($b === $s) {
die('<center style="color: #000; background-color: #FFF; height:100vh; font-size: 4vw;">Not A Valid Request URL</center>');
} else if($_REQUEST['b_id'] == $_REQUEST['s_id']) {
die('<center style="color: #000; background-color: #FFF; height:100vh; font-size: 4vw;">Not A Valid Request URL</center>');
}
PS the code works as expected. I just need help making it neater little less confusing.
$c
? \$\endgroup\$