From 4cf9f62357b89ac2b7ba24b26757c3b75573bdf3 Mon Sep 17 00:00:00 2001 From: Waldo Jaquith Date: Sun, 15 Sep 2019 21:23:27 -0400 Subject: [PATCH] Paste in HTML template This isn't pretty, but it's...pretty? Point is, it's a step toward #72, and necessitates #91. --- business.php | 79 ++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 68 insertions(+), 11 deletions(-) diff --git a/business.php b/business.php index 8ae17c9..7689478 100644 --- a/business.php +++ b/business.php @@ -2,12 +2,27 @@ function get_content($url) { + $ch = curl_init(); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_URL, $URL); - $data = curl_exec($ch); + + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_HEADER, 0); + curl_setopt($ch, CURLOPT_TIMEOUT, 60); + curl_setopt($ch, CURLOPT_MAXREDIRS, 10); + curl_setopt($ch, CURLOPT_AUTOREFERER, true); + curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate'); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + $string = curl_exec($ch); curl_close($ch); - return $data; + + if (empty($string)) + { + return FALSE; + } + + return $string; + } /* @@ -42,17 +57,59 @@ function get_content($url) header($_SERVER["SERVER_PROTOCOL"]." 500 Internal Server Error", true, 500); exit(); } +?> + + + + + + + Virginia Businesses + + + + + + + +

Virginia Businesses

+ +
+ + + + + + + + + +'; foreach ($business as $field_name => $field_value) { - echo ''; + echo ''; } -echo '
'; - echo $field_name; - echo ''; - echo $field_value; - echo '
' . $field_name . '' . $field_value . '
'; + +?> + + + + +
+ + + +