I am trying to submit a form with two conditions regulated by a checkbox. If the second condition is true, I get a warning message--Undefined array key "outside" in C:\xampp\htdocs\Taxi. I tried the following code:
if (isset($_POST['assign'])){
    $tid=addslashes($_POST['tid']);
    require 'dbconnect.php';
    if(addslashes($_POST['outside']))
    {
        $outside=addslashes($_POST['outside']);
        $outinv=addslashes($_POST['inv']);
        $sql = "UPDATE trips SET inventory='$outside',cardetails='$inv' WHERE id='$tid'";
        $stmt = $con->prepare($sql);
        $stmt->execute();
    }
    else if(!addslashes($_POST['outside'])){
        $asn=addslashes($_POST['asn']);
        echo $asn;
    }
}
 
     
    