PC Review


Reply
Thread Tools Rate Thread

Can I 'get' a result from a web page

 
 
Matthew
Guest
Posts: n/a
 
      24th Aug 2010
Help

A bit of a cheeky question.

I have found a webpage that allows a simple calculation of distance
between to postcodes.

its all free etc

I wondered if it is possible to send to the page from excell the 2
codes and return the answer ?

The bit of code on the sit is for a web page included might help.

<iframe src="http://www.PostCode.org.uk/free-postcode-distance-
calculator/distance-calculator.asp" scrolling="auto" frameborder="0"
height="220" width="375"></iframe>

Any ideas as this is wayyyyyy beyond me.

Regards

Matthew
 
Reply With Quote
 
 
 
 
Matthew
Guest
Posts: n/a
 
      24th Aug 2010
On 24 Aug, 18:18, Matthew <harriso...@btopenworld.com> wrote:
> Help
>
> A bit of a cheeky question.
>
> I have found a webpage that allows a simple calculation of distance
> between to postcodes.
>
> its all free etc
>
> I wondered if it is possible to send to the page from excell the 2
> codes and return the answer ?
>
> The bit of code on the sit is for a web page included might help.
>
> <iframe src="http://www.PostCode.org.uk/free-postcode-distance-
> calculator/distance-calculator.asp" scrolling="auto" frameborder="0"
> height="220" width="375"></iframe>
>
> Any ideas as this is wayyyyyy beyond me.
>
> Regards
>
> Matthew


Ahha, a bit of browsing and I find an alternative way using Haversine
Now could someone turn this into a macro please

function getDistance($lat1, $long1, $lat2, $long2)
{
//$earth = 6371; //km change accordingly
$earth = 3960; //miles

//Point 1 cords
$lat1 = deg2rad($lat1);
$long1= deg2rad($long1);

//Point 2 cords
$lat2 = deg2rad($lat2);
$long2= deg2rad($long2);

//Haversine Formula
$dlong=$long2-$long1;
$dlat=$lat2-$lat1;

$sinlat=sin($dlat/2);
$sinlong=sin($dlong/2);

$a=($sinlat*$sinlat)+cos($lat1)*cos($lat2)*($sinlong*$sinlong);

$c=2*asin(min(1,sqrt($a)));

$d=round($earth*$c);

return $d;
}

Thanks

Matthew

 
Reply With Quote
 
Pete_UK
Guest
Posts: n/a
 
      25th Aug 2010
If you send me an email to:

pashurst <at> auditel.net

(change the obvious), then I can send you an Excel file which allows
you to put in two postcodes (up to the space) and then calculates the
distance between them.

Hope this helps.

Pete

On Aug 24, 7:11*pm, Matthew <harriso...@btopenworld.com> wrote:
> On 24 Aug, 18:18, Matthew <harriso...@btopenworld.com> wrote:
>
>
>
>
>
> > Help

>
> > A bit of a cheeky question.

>
> > I have found a webpage that allows a simple calculation of distance
> > between to postcodes.

>
> > its all free etc

>
> > I wondered if it is possible to send to the page from excell the 2
> > codes and return the answer ?

>
> > The bit of code on the sit is for a web page included might help.

>
> > <iframe src="http://www.PostCode.org.uk/free-postcode-distance-
> > calculator/distance-calculator.asp" scrolling="auto" frameborder="0"
> > height="220" width="375"></iframe>

>
> > Any ideas as this is wayyyyyy beyond me.

>
> > Regards

>
> > Matthew

>
> Ahha, a bit of browsing and I find an alternative way using Haversine
> Now could someone turn this into a macro please
>
> function getDistance($lat1, $long1, $lat2, $long2)
> {
> //$earth = 6371; //km change accordingly
> $earth = 3960; //miles
>
> //Point 1 cords
> $lat1 = deg2rad($lat1);
> $long1= deg2rad($long1);
>
> //Point 2 cords
> $lat2 = deg2rad($lat2);
> $long2= deg2rad($long2);
>
> //Haversine Formula
> $dlong=$long2-$long1;
> $dlat=$lat2-$lat1;
>
> $sinlat=sin($dlat/2);
> $sinlong=sin($dlong/2);
>
> $a=($sinlat*$sinlat)+cos($lat1)*cos($lat2)*($sinlong*$sinlong);
>
> $c=2*asin(min(1,sqrt($a)));
>
> $d=round($earth*$c);
>
> return $d;
>
> }
>
> Thanks
>
> Matthew- Hide quoted text -
>
> - Show quoted text -


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Page Load Using Result From Previous Page Mike Bussiere Microsoft Frontpage 2 23rd Nov 2006 10:31 PM
Frontpage result page =?Utf-8?B?cGFzdG9yNHRoZW1hc3Rlcg==?= Microsoft Frontpage 0 29th Oct 2006 10:50 PM
Opening Web Page AND Getting Result =?Utf-8?B?TWljaGFlbA==?= Microsoft Access VBA Modules 2 9th Oct 2006 02:21 AM
result is blank page =?Utf-8?B?RGlubw==?= Microsoft Access 3 31st Aug 2006 10:35 PM
different search and result page devccon@gmx.de Microsoft ASP .NET 1 29th Apr 2005 01:32 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:07 PM.