this might be a stupid question, but I'm doing simple form for editing data in database in PHP, but I can't figure out, where is mistake, it only keeps telling me, that I have undefined index
<table>
<tr>
<td><input type="text" name="first"></td>
<td><input type="text" name="sur"></td>
</tr>
<tr>
<td><input type="submit" name="edit" value="Firstname":</td>
<td><input type="submit" name="edit" value="Surname"></td>
</tr>
<?php
if($_POST['edit']=='Firstname')
{
$firstchange=$_POST['first'];
}
elseif($_POST['edit']=='Surname')
{
$surchange=$_POST['sur'];
}
?>
Notice: Undefined index: edit in edit.php on line 177
Notice: Undefined index: edit in edit.php on line 183
This happens when I open the page. And I'm dissapointed I couldn't find what's wrong.