I have two pages where one links one to the other. How can i pass the value of the variable(region_name) in my anchor(select.php) to the next page(display.php)? i used the following codes and im getting Notice: Undefined variable: region_name
.how do i fix it?
select.php
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a name="region_name" method="POST" value="Greater Accra Region" type="submit" href="display.php" target="main">Greater Accra Region</a>
</h4>
</div>
</div>
display.php
<?php
ob_start();
session_start();
if(isset($_POST['region_name'])){
$region_name = $_POST['region_name'];
}
$con=mysqli_connect("localhost","root","root","findings");
// Check connection
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql="SELECT * FROM approved_reservation WHERE region_name = '$region_name'";
$records=mysqli_query($con,$sql);
?>