How can i make a search from the form in an HTML page display the result in the same html page? Am having an error when i try and run the code that says inputPackageID is not defined. How can i get to solve this. Seems like the variable is not being recognized from the form. Please help
Here is my code. If you dont understand my question you can ask me where you are not clear.
<div class="main">
<div class="col-md-12">
<div class="row">
<div class="container">
</div>
<div class="search center-block col-md-6" align="center">
<p>
Want to track your package? <br />
Enter your Package ID(PID)
</p>
<form method="post" action="trackShipment.php">
<div class="form-group">
<label class="sr-only" for="inputPackageID"></label>
<input type="search" name="inputPackageID" class="form-control edit-form-control" id="inputPackageID" placeholder="PID">
</div>
<div class="modal-footer">
<input type="submit" class="btn btn-primary" name="submit" />
</div>
</form>
</div>
<div class="col-md-8" align="center">
<h2>Well, Here is your package!</h2>
<?php
include '../includes/connection.php';
//include 'phpscripts/trackShipment.php';
$PackageID = $_GET['inputPackageID'];
$sql = "select * from package where p_id='$PackageID'";
?>
<table class="table table-striped">
<tr>
<th><span>PID</span></th>
<th><span>Customer ID</span></th>
<th>Name</th>
<th>Description</th>
<th>Destination Per KM</th>
<th>Type</th>
<th>Price/KG</th>
</tr>
</th>
<?php
foreach ($db->query($sql) as $count)?>
<tr>
<td>
<?php echo $count['p_ID']; ?>
</td>
<td>
<?php echo $count['cus_ID']; ?>
</td>
<td>
<?php echo $count['package_name']; ?>
</td>
<td>
<?php echo $count['package_description']; ?>
</td>
<td>
<?php echo $count['package_type']; ?>
</td>
<td>
<?php echo $count['destination_per_km']; ?>
</td>
<td>
<?php echo $count['price_per_kg']; ?>
</td>
<?php } ?>
</table>
</div>
</div>