Passing Request Variables
Quick Link
The simpliest form of this method is to click on the link below (use the browser's back button to return to here).
https://www.zip2tax.com/Link/Lookup.asp?zip=90210&usr=sample&pwd=password
Or you can paste this line of code into any browser's URL box.
You will see that you looked up the data using the request variables. You may wish to try other zip codes to see the results. Keep in mind that when experimenting with the sample username and password combination you are only allowed zip codes between 90001 and 92999. When you become a subscriber to our service you can use the exact same code only having to replace the username and password with your own.
This example shows our basic version of tax information giving you the total rate. You may require our full breakout
information which returns all the components (State, County, City and Special District) of the total.
By clicking the link below you can view this.
https://www.zip2tax.com/Link/Lookup_Extended.asp?zip=90210&usr=sample&pwd=password
Return the Results to your custom page
Now we want to have the
results passed back to us in a page we custom designed. At the end of the URL we are going to add a
request variable named ret as shown.
https://www.zip2tax.com/Link/Lookup.asp?zip=90210&usr=sample&pwd=password&
ret=https://www.Zip2Tax.com/Link/DisplayResults.asp
Instead of displaying the results directly to the browser as in the Quick Link example, the data is being passed to a page of your choosing which is displaying the data. This new page should reside on your server and can be written in any language. Below are samples using ASP and PHP.
Display Request Variable Results Using ASPZip_Code: <%=Request("Zip_Code")%><br>
Sales_Tax_Rate: <%=Request("Sales_Tax_Rate")%><br>
Post_Office_City: <%=Request("Post_Office_City")%><br>
County: <%=Request("County")%><br>
State: <%=Request("State")%><br>
Shipping_Taxable: <%=Request("Shipping_Taxable")%><br>
echo('This is a separate php page.<br><br>');
echo('Zip_Code: ');
echo($_REQUEST['Zip_Code'].'<br>');
echo('Sales_Tax_Rate: ');
echo($_REQUEST['Sales_Tax_Rate'].'<br>');
echo('Post_Office_City: ');
echo($_REQUEST['Post_Office_City'].'<br>');
echo('County: ');
echo($_REQUEST['County'].'<br>');
echo('State: ');
echo($_REQUEST['State'].'<br>');
echo('Shipping_Taxable: ');
echo($_REQUEST['Shipping_Taxable'].'<br>');
?>
Sample ZIP Code Range
In the sample ZIP code range (90001 - 90999), the following ZIP codes contain multiple tax rates; which can be used to test the return of multiple rows:
- 90304
- 90601
- 90631