Any PHP page is capable of being included in another; You dont even actually NEED a second page to do this. Below is a mock-up, which you should be able to use.
PHP Code:
<html>
<head></head>
<body>
<?php
if(isset($_POST['zip'])) {
//Do your Database queries and such here; Output results.
$db = new mysqli('localhost','username','password','databasename');
$res = $db->query("SELECT name,distance FROM zipcodes WHERE zip = '".$_POST['zip']."'");
while($place = $res->fetch_array()) {
echo $place['name']." : ".$place['distance']."<br />";
}
}
?>
<form action="" method="post">
Input your Zip Code Here: <input type='text' name='zip'><br />
<input type='submit' value='Find Me'></form>
</body>
</html>
Bookmarks