This code gets me where I need to be, but my word it is ugly.
I am checking for the existence of two $_GET variables with if() statements. I am setting the variables to empty strings first so I do not get an error when I echo them back.
$getvar1 ='';
$getvar2 ='';
$np ='';
if(isset($_GET['getvar1'])) $page_id = $_GET['getvar2'];
if(isset($_GET['getvar2'])) $route = $_GET['getvar2'];
if(($getvar1 == '' && $getvar1 == '') || $getvar1 == '4') $np = 'np';
echo "$getvar1 $getvar2 $np";
Is there a better way to declare the variables than setting them to empty strings?
Is there a better way to check and set the $_GET variables?