Skip to content

Commit

Permalink
Paste in HTML template
Browse files Browse the repository at this point in the history
This isn't pretty, but it's...pretty? Point is, it's a step toward #72, and necessitates #91.
  • Loading branch information
waldoj committed Sep 16, 2019
1 parent 2c8770b commit 4cf9f62
Showing 1 changed file with 68 additions and 11 deletions.
79 changes: 68 additions & 11 deletions business.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

}

/*
Expand Down Expand Up @@ -42,17 +57,59 @@ function get_content($url)
header($_SERVER["SERVER_PROTOCOL"]." 500 Internal Server Error", true, 500);
exit();
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Virginia Businesses</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="mini-default.min.css" />
</head>

<body>

<h1>Virginia Businesses</h1>

<article>
<table>
<thead>
<tr>
<th scope="col"></th>
<th scope="col"></th>
</tr>
</thead>
<tbody>

<?php

/*
* Display a table of all field values
*/
echo '<table>';
foreach ($business as $field_name => $field_value)
{
echo '<tr><td>';
echo $field_name;
echo '</td><td>';
echo $field_value;
echo '</td></tr>';
echo '<tr><td>' . $field_name . '</td><td>' . $field_value . '</td></tr>';
}
echo '</table>';

?>

</tbody>
</table>

</article>
<footer class="wrapper">
All business records are created by the Virginia State Corporation Commission, and
are thus without copyright protection, so may be reused and reproduced freely,
without seeking any form of permission from anybody. All other website content is
published under <a href="http://opensource.org/licenses/MIT">the MIT license</a>.
This website is an independent, private effort, created and run as a hobby, and is
in no way affiliated with the Commonwealth of Virginia or the State Corporation
Commission. <a href="https://github.com/openva/vabusinesses.org">All site source
code is on GitHub</a>—pull requests welcome.
</footer>

</body>
</html>

0 comments on commit 4cf9f62

Please sign in to comment.