Can anyone tell what is wrong with my coding? There is undefined variable on every "$current...". Why does it has error while when i click on the search button, the result come out in the table?
<html>
<head><title>Search Book</title>
<link href="css/bootstrap.css" rel="stylesheet">
</head>
<body>
<div class="container" align="center">
<div class="row">
<div class="col-md-5">
<form method="get" action="" class="form-horizontal" name="search"><br>
<table border="0" bgcolor="#E0FFFF">
<td><h3>Search Book By ISBN:</h3></td>
<div class="form-group">
      <td><input type="text" name="id" class="form-control" placeholder="eg: 978-0320037825"></td>
      </div>
      <br/>
      <tr><td><center><button type="submit" class="btn btn-success">Search</button> </center></td>
      <td><a href="index.php">Back</a></td></tr>
<tr><td>
<?php
if (isset($_GET['id']) !='')
{
    $id = $_GET['id'];
    $xml = simplexml_load_file("bookstore.xml");
    $notThere = True;
    foreach ($xml->children() as $book)
    {
            if ($book->isbn == $id)
            {
                    $currentisbn = $book->isbn;
                    $currenttitle = $book->title;
                    $currentfirstname = $book->firstname;
                    $currentlastname = $book->lastname;
                    $currentprice = $book->price;
                    $currentyear = $book->year;
                    $currentpublisher = $book->publisher;
                    $notThere = False;
            }
    }
    if($notThere)
            {
                echo "ISBN Does Not Exist!";
            }
}
?>
</td>
</tr>
</table>
</form>
<html>
<form method="POST" action="" class="form-horizontal" name="delete">
  <table width="600" bgcolor="#ffffff" border="1" cellpadding="8">
  <tr colspan="2"><h2>Delete Book</h2></tr>
    <tr>
      <td width="150">ISBN</td>
      <td width="320"><?php echo $currentisbn;?></td>
    </tr>
    <tr>
      <td width="150">Title</td>
      <td width="320"><?php echo $currenttitle;?></td>
    </tr>
    <tr>
      <td>First Name</td>
      <td><?php echo $currentfirstname;?></td>
    </tr>
    <tr>
      <td>Last Name</td>
      <td><?php echo $currentlastname;?></td>
    </tr>
    <tr>
      <td width="150">Price</td>
      <td width="320"><?php echo $currentprice;?></td>
    </tr>
    <tr>
      <td width="150">Year</td>
      <td width="320"><?php echo $currentyear;?></td>
    </tr>
    <tr>
      <td width="150">Publisher</td>
      <td width="320"><?php echo $currentpublisher;?></td>
    </tr>
      <td colspan="2" align="center"> <input name="submit" type="submit" value="Delete"/>  
      <a class="btn btn-default" href="index.php" role="button">Home</a></td>
    </tr>
</table>
</form>
<?php
if (isset($_GET['id'])!='' && isset($_POST['submit'])!=''){
    $id = $_GET['id'];
    $success=False;
    $dom = new DOMDocument();
    $dom -> load("bookstore.xml");
    $xpath = new DOMXpath($dom);
    $node = $xpath->query("//*[isbn='$id']");
    foreach ($node as $book) 
                {   
                    $book->parentNode->removeChild($book);
                    $success=True;
                } 
    if($success)
    {
        echo "<h1 style='text-align: center;'>Successfully Deleted!</h1>";
    }
     $dom->save("bookstore.xml");
}
?>  
<script>
function goBack() {
    window.history.back();
}
</script>
</html>
 
     
    