diff --git a/RX.php b/RX.php
new file mode 100644
index 0000000..077697b
--- /dev/null
+++ b/RX.php
@@ -0,0 +1,103 @@
+query('SELECT rowid,* FROM pharmacies');
+ foreach ($result as $row) {
+ $distance = $geo->straight_line_distance($Lat, $Lon, $row['Latitude'], $row['Longitude'], 'N');
+ if ($distance < $shortest)
+ {
+ $pharmacy = $row['Pharmacy'];
+ $address = $row['Address'];
+ $city = $row['City'];
+ $state = $row['State'];
+ $zip = $row['Zip'];
+ $latitude = $row['Latitude'];
+ $longitude = $row['Longitude'];
+ $shortest = $distance;
+ }
+ }
+ $db = NULL;
+ }
+ catch(PDOException $e)
+ {
+ echo 'PDO Exception: ' . $e-> getMessage();
+ exit;
+ }
+ break;
+// case 'POST':
+// break;
+// case 'PUT':
+// break;
+// case 'DELETE':
+// break;
+ default:
+ // Invalid Request Method
+ header("HTTP/1.0 405 Method Not Allowed");
+ exit;
+ }
+
+ // Output JSON back to HTML file.
+ echo 'Closest Pharmacy To you is:
';
+ echo $pharmacy . '
';
+ echo $address . '
';
+ echo $city . '
';
+ echo $state . '
';
+ echo $zip . '
';
+ echo '
';
+// echo $latitude . '
';
+// echo $longitude . '
';
+ echo 'Distance of - ' . round($shortest, 1) . ' mile(s) away.
';
+ exit;
+
+// ##### END OF PROGRAM ################################################################################################
+
+ /**
+ * GetParam - Returns the GET or POST values, and allows for defaults if not present.
+ * @param $param_name
+ * @param null $default
+ *
+ * @return string|null
+ */
+ function GetParam($param_name, $default=NULL)
+ {
+ global $_POST;
+ global $_GET;
+ $param_value = "";
+
+ if(isset($_POST[$param_name]))
+ $param_value = $_POST[$param_name];
+ else if(isset($_GET[$param_name]))
+ $param_value = $_GET[$param_name];
+ else if($param_value === '')
+ $param_value = $default;
+
+ return $param_value;
+ }
diff --git a/classes/geocode.php b/classes/geocode.php
new file mode 100644
index 0000000..d864fbb
--- /dev/null
+++ b/classes/geocode.php
@@ -0,0 +1,35 @@
+
-
Please enter a Latitude and Longitude
+Please enter a Latitude and Longitude
+