File: D:/web/vintagedoorknobs/inc-pages.asp
<%
' called for every request, calls the appropriate routine, page holds the page name, defaults to products'
' (SS,17/4/12) modified to allow pages directly from sitedetails table without needing separate templates for customer info, about, how to order, links etc.
' (SS,22/5/12) added reviews
' (SS,17/1/13) added hook to CustomShowPageContent for content from third party SEO company
' (SS,12/12/18) Added HTMLEncode to render of page name (FPageName) chosen to prevent XSS
' (SS,30/10/23) Added FPageName = "blog" DoBlogPage, new template file (inc-template-blog.asp)
' (SS,20/11/24) added "test-home" for test version for home pages
Dim FPageName
FPageName = LCase(Request.QueryString("page"))
' (SS,1/7/11) added Request.QueryString("search") <> ""
' (SS,7/10/15) added missing brackets after the "And"
If FPageName = "products" Or (FPageName = "" And (Request.QueryString("cmd") <> "" Or Request.QueryString("code") <> "" Or Request.QueryString("cat") <> "" Or Request.QueryString("search") <> "")) Then
ShowPage_products
' (SS,20/6/11) added demolition
ElseIf FPageName = "demolitionservices" Then
ShowPage_demolition
ElseIf FPageName = "contact" Then
DoContactForm
' (SS,22/5/12)
ElseIf FPageName = "reviews" Then
DoReviewsPage
ElseIf FPageName = "account" Then
DoAccount ' (SS,22/6/09) replaced DoCreateAccountForm, DoAccountLogout, DoAccountLogin and DoForgotPassword with just DoAccount
ElseIf FPageName = "btucalculator" Then ' (SS,23/6/11)
ShowPage_btucalculator
ElseIf FPageName = "radiatorbuilder" Then ' (SS,15/7/11)
ShowPage_radiatorbuilder
ElseIf FPageName = "blog" Then ' (SS,30/10/23)
DoBlogPage
' (SS,20/11/24) added Or InStr(1, FPageName, "test-home-") > 0
ElseIf FPageName = "" Or FPageName = "home" Or InStr(1, FPageName, "test-home-", vbTextCompare) > 0 Then
ShowPage_home
ElseIf PageExists(FPageName) Then
ShowPageContent(FPageName)
' if IIS has redirect to 404 error page (i.e. page=404) then set the status to 404
If FPageName = "404" Then
Response.Status = "404 Not Found" ' tells the browser that page was not found
End If
' (SS,17/1/13) added CustomPage for integration with content from SEO company
ElseIf CustomPagesEnabled And CustomPageExists(FPageName) Then
CustomShowPageContent(FPageName)
Else ' page doesn't exist so return 404 error, and display page does not exist message
' (SS,12/12/18) Added HTMLEncode to FPageName to prevent XSS
Response.Write "<strong>Sorry, page '" & HTMLEncode(FPageName) & "' does not exist.</strong>"
Response.Status = "404 Not Found" ' tells the browser that page was not found
End If
%>