<% Set oC = Server.CreateObject("ADODB.Connection") oC.Open "driver={MySQL ODBC 3.51 Driver}; server=localhost; uid=dinaj; pwd=dinaj; database=dinaj;}" strCode = UCase( Request.QueryString("dinaj") ) set rs1 = oC.Execute( "select stationname from dinaj where station='" & strCode & "'" ) if rs1.EOF Then set rs2 = oC.Execute( "select name, state, country, latitude, longitude from metarairports where icao='" & strCode & "'" ) If rs2.EOF Then set rs3 = oC.Execute( "select name, state, country, latitude, longitude from metarlocations where icao='" & strCode & "'" ) If rs3.EOF Then ' nothing to do Else strStationName = rs3("name") strState = rs3("state") strCountry = rs3("country") strLatitude = rs3("latitude") strLongitude = rs3("longitude") Response.redirect( "http://www.doineedajacket.com/weather/" & strStationName & "_" & strState & "_" & strCountry ) End If Else strStationName = rs2("name") strState = rs2("state") strCountry = rs2("country") strLatitude = rs2("latitude") strLongitude = rs2("longitude") Response.redirect( "http://www.doineedajacket.com/weather/" & strStationName & "_" & strState & "_" & strCountry ) End If Else strStationName = rs1("stationname") Response.redirect( "http://www.doineedajacket.com/weather/" & Replace( strStationName , " ", "_" ) ) End if %>