表格中有多个if和elseif语句

I have a form on a single page, if it don't have a id I want it to insert. but if there is an id then update.

I am having difficulties getting the form values to display in the button.

I am also not sure my if or else if statement is plausible.

<?php
function myform(){
    if(isset($_POST['add'])) {
        if ($myform_id > 0) {
            //my insert query here      
            $btn_value = "add";
            $btn_name = "add";

        }elseif(isset($_POST['edit'])){
            //my update query here        
            $btn_value = "edit";
            $btn_name = "edit";
        } 
    }
}
?>

My form button

<input type="submit" name="<? $btn_name?>" value="<? $btn_value?>">

try this

<input type="submit" name="<?echo $btn_name;?>" value="<? echo $btn_value;?>">

within the php tag itself give the following statement

print "<input type='submit' name='$btn_name' value='$btn_value'>";