here is my code. i get this error Notice: Undefined variable: fname in C:\xampp\htdocs\health\admin\newpat.php on line 282
Notice: Undefined variable: lname in C:\xampp\htdocs\health\admin\newpat.php on line 282
<label for="fname" class="col-md-2"> First Name: </label>
    <div class="col-md-6">
        <input type="text" class="form-control" id="fname" name="fname"
            placeholder="Enter First Name">
    </div>
    <br />
    <br />
    </div>
    <div class="form-group">
        <label for="lname" class="col-md-2"> Last Name: </label>
        <div class="col-md-6">
            <input type="text" class="form-control" id="lname" name="lname"
                placeholder="Enter Last Name">
        </div>
        <br /> <br />
    </div>
here is the php code:
<?php
        extract($_POST);
        $image = addslashes (file_get_contents($_FILES['image']['tmp_name']));
        $imageta = getimagesize($_FILES['image']['tmp_name']);//to know about image type etc
        $imagetype = $imageta['mime'];
        $query = mysql_query("SELECT * FROM patient WHERE fname='$fname' AND lname = '$lname'");
         if(mysql_num_rows($query)==0){
        if(isset($reg)){
          $patsql= "INSERT INTO `patient`(`fname`, `lname`, `birthday`, `address`, `work`, `civil`, `gender`, `btype`, `height`, `weight`, `fallergy`, `mallergy`, `image`, `imagetype`) VALUES ('$fname','$lname','$dob','$address','$work')";
        }
      }
  ?>
 
     
    