Okay, it's almost working, but I am getting some strange results. If I enter garbage data in all three fields, I do get a valid string returned like this:
LocationCode=-1 Rate=-1 ResultCode=4 debughint=Invalid ZIP
However, if I enter a valid address, it says $foo is boolean. If I enter this same address using the header-location method, the tax data shows correctly on the screen, so I can't figure out why file_get_contents can't seem to parse it.
Here's the latest revised test script. Try this with "123 west main st", "monroe",
"98272":
<?php
$addr = $POST['address'];
$city = $POST['city'];
$zip = $_POST['zip'];
$foo= 'nothing';
// header('location:http://dor.wa.gov/AddressRates.aspx?output=text&addr=' . $addr .'&city=' . $city . '&zip='. $zip );
$foo = file_get_contents('http://dor.wa.gov/AddressRates.aspx?output=text&addr=' . $addr .'&city=' . $city . '&zip='.
$zip );
echo 'The address is ' . $addr . ' ' . $city . ' ' . $zip;
echo '<br>';
echo "Foo is: ". $foo;
echo '<br>';
echo 'Var type of foo is ' . gettype($foo);
?>