Browse files

Use a postcode that is set if come via lat/lon, and make sure it's

encoded.
  • Loading branch information...
1 parent 6fbdd4f commit 9a3c9a243a2b2ce373e96b707895e9802d0ed29a @dracos dracos committed Jun 22, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 postcode.php
View
4 postcode.php
@@ -86,7 +86,7 @@
if (strlen($row['electoraldistrict']) == 0) {
- $mapit = json_decode(file_get_contents("http://mapit.mysociety.org/postcode/". urlencode($postcode) .".json"));
+ $mapit = json_decode(file_get_contents("http://mapit.mysociety.org/postcode/". urlencode($updatepostcode) .".json"));
foreach ($mapit->areas as $area) {
if ($area->type_name == "County council ward") {
@@ -126,7 +126,7 @@
if (strlen($row['parish'] == 0)) {
- $mapit = json_decode(file_get_contents("http://mapit.mysociety.org/postcode/". $postcode .".json"));
+ $mapit = json_decode(file_get_contents("http://mapit.mysociety.org/postcode/". urlencode($updatepostcode) .".json"));
foreach ($mapit->areas as $area) {
if ($area->type_name == "Civil Parish") {

0 comments on commit 9a3c9a2

Please sign in to comment.