Recently, due to the needs of work, design a web page requires to make an advertisement on the company's website, if you do, if you don't show the company's resource information, below Let us realize its process. <%
COM = Request ("Company") 'first accepts company names from another table com = Replace (COM, "", "") COM = Replace (com, ";", "") SQL = "SELECT * From the name of WHERE Corporate name = '"& com&" "rs.open sql, conn, 1 ,1 if r.eof and rs.bof dam = r r 这个 是 是 是 r" "" ELSE SHOW = RS "" ("CompanySHOW") 'Here, the companyShow is stored for the page of the corresponding company's advertising, show = trim (show)
IF RS ("Company") <> com the 'to judge that the company does not exist, there is no jump to home page Response.Redirect ("Home") Else IF RS ("Company_SHOW" <> "" "" "" To determine whether there is an advertisement response.redirect "FLACK /" & "? Company =" & com& "" If an advertisement, the advertisement is executed, the advertisement page else response.Redirect "abc.asp? Company =" & "is displayed Resource page end if rs.close set = Nothing end if End if%> Select the code above, use redirect very simple to do something you want. Here, it is necessary to pay special attention to the use of REDIRECT it is "" "usage of variables in the number, and the variable number of variables there is not the same as the usage of SQL.