mackin Posted November 29, 2011 Share Posted November 29, 2011 Hi, I have this code but i cant get it to work. I have broken it down to sections and I think the get file contents may be at fault as when i dump the array it come back bool false. The URL creates a page with CSV values of longitude and latitude from a postcode. I want to give the variables $custlat1 and $custlong1 the values from the geocoded co-ordinates. The CSV values returned from the URL input are 200,5,54.1202442,-3.2078272 $pc1 = 'http://maps.google.com/maps/geo?q=la139hu,+UK&output=csv&sensor=false&key=ABQIAAAAcclaxnepdvvxx5D2PAnHtRSLcuoGw6G6HnB4VN4WqoMz7tmtKhTHGV82iKKTXvAg7YFpCFA6ptRc9g'; $data1 = @file_get_contents($pc1); $result1 = explode(",", $data1); $custlat1 = $result1[2]; $custlong1 = $result1[3]; can anyone help? or point me in the right direction Quote Link to comment https://forums.phpfreaks.com/topic/252042-postcode-search-geocode-help/ Share on other sites More sharing options...
ManiacDan Posted November 29, 2011 Share Posted November 29, 2011 The @ before your function call suppresses errors. Never ever turn off errors, especially when you're trying to debug. Remove the @ and you should be able to see what's wrong. Quote Link to comment https://forums.phpfreaks.com/topic/252042-postcode-search-geocode-help/#findComment-1292260 Share on other sites More sharing options...
mackin Posted November 29, 2011 Author Share Posted November 29, 2011 i shall do that now maniac thx - ill be back Quote Link to comment https://forums.phpfreaks.com/topic/252042-postcode-search-geocode-help/#findComment-1292262 Share on other sites More sharing options...
mackin Posted November 29, 2011 Author Share Posted November 29, 2011 BUGGER!! Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /homepages/27/d374255998/htdocs/ship/bandb.php on line 184 i guess there aint much i can do about this? Quote Link to comment https://forums.phpfreaks.com/topic/252042-postcode-search-geocode-help/#findComment-1292264 Share on other sites More sharing options...
ManiacDan Posted November 29, 2011 Share Posted November 29, 2011 You could enable it in the server configuration file, or use curl. Quote Link to comment https://forums.phpfreaks.com/topic/252042-postcode-search-geocode-help/#findComment-1292294 Share on other sites More sharing options...
mackin Posted November 29, 2011 Author Share Posted November 29, 2011 enabled it on server (didnt think i was allowed to) works perfectly now Thx for advice Dan u maniac Quote Link to comment https://forums.phpfreaks.com/topic/252042-postcode-search-geocode-help/#findComment-1292312 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.