<% if Request.QueryString("bid") = "" then Response.Redirect("http://www.anandabazar.com/") dim rs,strRefferer strRefferer=Request.ServerVariables("HTTP_REFERER") '// If the click is coming from the anandautsav.com site then if trim(Request.QueryString("ref")) = "puja" then strRefferer = "http://www.anandautsav.com" '// If the click is coming from the telegraphindia.com site then if trim(Request.QueryString("ref")) = "tt" then strRefferer = "http://www.telegraphindia.com" '// If the click is coming from the ananadabazar.com site then if strRefferer = "" then strRefferer = "http://www.anandabazar.com" set rs = con.execute ("select URL from banners where BannerID=" & Request.QueryString("bid")) con.execute "update banners set visits=visits+1 where BannerID=" & Request.QueryString("bid") con.execute "insert into visits (bannerid,remote_addr,path_info,http_user_agent) values (" & Request.QueryString("bid") & ",'" & Request.ServerVariables("remote_addr") & "','" & strRefferer & "','" & Request.ServerVariables("http_user_agent") & "')" if not rs.eof then Response.Redirect (cstr(rs("URL"))) else Response.Redirect("http://www.anandabazar.com/") end if set rs = nothing %>