I have a search box and results, when I click the result and directed to a specific page I want the result to show at the header of directed page with php.
This is the result page:
<?php
$host="localhost";
$user="a";
$pass="a";
$db="pax";
mysql_connect($host,$user,$pass);
mysql_select_db($db);
$button = $_GET['submit'];
$search = $_GET['search'];
if (!$button)
echo "you didn't submit a keywoard";
else
{
if (strlen($search)<=2)
echo " Search term too short";
else
{
echo " you searched for $search<hr size='1'>";
}
}
$sql="select * from names where names like '%$search%'";
$query = mysql_query($sql);
while($row=mysql_fetch_array($query)){
echo '<a href=directedpage.php </a>'. "<br>".$row['names'];
}
?>