Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<%
strChosen="1.00"
strXML= "<?xml version='1.0'?><RateV2Request USERID='userID' PASSWORD='password'>"
strXML=strXML & "<Package ID='0'><Service>ALL</Service>"
strXML=strXML & "<ZipOrigination>10022</ZipOrigination>"
strXML=strXML & "<ZipDestination>20008</ZipDestination>"
strXML=strXML & "<Pounds>10</Pounds>"
strXML=strXML & "<Ounces>5</Ounces>"
'strXML=strXML & "<Container>Flat Rate Box</Container>"
strXML=strXML & "<Size>LARGE</Size>"
strXML=strXML & "<Machinable>TRUE</Machinable>"
strXML=strXML & "</Package>"
strXML=strXML & "</RateV2Request>"
strXML=server.URLEncode(strXML)
strXML="API=RateV2&XML=" & strXML
Set strXMLhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
strXMLhttp.Open "POST","http://testing.shippingapis.com/ShippingAPITest.dll?",false
strXMLhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
strXMLhttp.send strXML
strResponseMessage = strXMLhttp.responseText
intHTTPStatusCode = strXMLhttp.status
strHTTPStatusText = strXMLhttp.statusText
'response.write strResponseMessage & "<BR>"
'response.write intHTTPStatusCode & "<BR>"
'response.write strHTTPStatusText & "<BR>"
'get the response
responsexml = strResponseMessage
Set mydoc=Server.CreateObject("Microsoft.xmlDOM")
mydoc.loadxml(responsexml)
Set NodeList = mydoc.documentElement.selectNodes("Package/Postage")
For strCount = 0 To NodeList.length - 1
Select case Left(NodeList.Item(strCount).selectSingleNode("MailService").Text,6)
case "Parcel"
Session("svUSPS0")="U.S.P.S. Parcel Post"
Session("svUSPSCost0")=(cdbl(NodeList.Item(strCount).selectSingleNode("Rate").Text)+cdbl(strChosen))
Session("svUPSOrder0")=1
strCount2=strCount2+1
CASE "Priori"
Session("svUSPS1")="U.S.P.S. Priority Mail"
Session("svUSPSCost1")=(cdbl(NodeList.Item(strCount).selectSingleNode("Rate").Text)+cdbl(strChosen))
Session("svUPSOrder1")=1
strCount2=strCount2+1
CASE "Expres"
Session("svUSPS2")="U.S.P.S. Express Mail"
Session("svUSPSCost2")=(cdbl(NodeList.Item(strCount).selectSingleNode("Rate").Text)+cdbl(strChosen))
Session("svUPSOrder2")=1
strCount2=strCount2+1
END SELECT
NEXT
session("svCount")=clng(strCount2)
response.write strCount2 & "<BR>"
'Create a select table from the response xml
response.Write("<select name=""txtShipping"" class=""searchfield"">") & vbcrlf
IF (request("txtShipping"))="0" or (request("txtShipping"))="" or (request("txtshipping"))=" " or isNULL((request("txtshipping"))) THEN
response.write "<Option value=""0"" selected><-- Select Shipping --></option>" & vbcrlf
ELSE
response.write "<Option value=""0""><-- Select Shipping --></option>" & vbcrlf
END IF
'TotalCharges/MonetaryValue
For strCount=0 to (clng(session("svCount"))-1)
IF (request("txtShipping"))= Session("svUSPS"&strCount) THEN
response.write("<option value=""" & Session("svUSPS"&strCount) & """ selected>")
ELSE
response.write("<option value=""" & Session("svUSPS"&strCount) & """>")
END IF
response.write Session("svUSPS"&strCount) & " - " & formatcurrency((Session("svUSPSCost"&strCount)),2)
response.write("</option>") & vbcrlf
Next
response.Write("</select>") & vbcrlf