I have a very basic search page (search.php) that pulls information from a MySQL database and displays it (results.php). This works fine, however if one is viewing the webpage in, say Internet Explorer, and does a "Save As," then saves the results page as "Web Page, Complete" and then views the saved .html document, all the entries in the database are shown instead of just the originally searched result. Any other suggestions to improve this script are appreciated too! Thanks.
Here is what I am using...
Apache/1.3.31 (Win32)
PHP/5.0.0RC3
MySQL/3.23.38
And here is the code...
<?
mysql_connect("localhost","username","password");
mysql_select_db("database");
$search=$_POST["search"];
$result = mysql_query("SELECT * FROM table WHERE business LIKE '%$search%'");
while($r=mysql_fetch_array($result))
{
$business=$r["business"];
$address=$r["address"];
$city=$r["city"];
$state=$r["state"];
$zip=$r["zip"];
echo "$business<br> $address, $city, $state $zip<br><br>";
}
?>