Hi all,
Currently, I work with 3 files: tour.html, menu.php & tour.php.
From menu.php
<li><a href="tour.html" class="parent_menu">Tour</a>
<ul>
<li><a href="tour.php?reg=North">North</a></li>
<li><a href="tour.php?reg=Middle">Middle</a></li>
<li><a href="tour.php?reg=South">South</a></li>
</ul>
</li>
From tour.php
<?php
$con = mysql_connect("localhost","...","...");
if(!$con) {
echo "Could not connect: " . mysql_error();
}
if(isset($_GET['reg'])){
$region = $_GET['reg'];
}
function display($region)
{
$result = mysql_query('Select * From tour Where regionID="'.$region.'"');
echo '<div id="title-text">'.$region.'</div>';
while($record = mysql_fetch_array($result))
{
...
}
}
mysql_close($con);
?>
My HTML File
<body>
...
<div id="topnav">
<?php include("menu.php") ?>
</div>
<div id="left-top">
<?php include("search_tool.php"); ?>
</div>
<div id="right-top">
<?php
include("tour.php");
display();
?>
</div>
</body>
I mean when users click a link from Tour (has 3 items), it will pass value of its item into tour.php to get $region. Then in the body (<div id="right-top">), it will display records by using function display(). But right now, when I click a href link, it displays nothing. So is there any way to differentiate a selection (of href) from users, and then pass it into body?
Thank you all 🙂